-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scylla/lib.rs: Remove stars in serialization frameworks imports #1090
Conversation
|
fab9fe1
to
31c5dc2
Compare
fa3c5aa
to
ed05c32
Compare
ed05c32
to
72d29ba
Compare
It is easier to see what is imported, and decide if it should be, if one can see what exactly is imported. This is hard to do with stars, so, as part of API stabilization effort, those are removed here. For now, I did not remove any imports, so this change should not be breaking.
There should be no need for users to use this - it is only used for interaction between scylla and scylla-cql.
72d29ba
to
f649822
Compare
/// Contains the [BatchValues][batch::BatchValues] and [BatchValuesIterator][batch::BatchValuesIterator] trait and their | ||
/// implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, so [][]
works as well? I only knew about []()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually you will notice that my third commit in this PR removes an occurence of []()
because it was rendered incorrectly.
I honestly have no idea how it works. This is the only syntax that I found that seems to do what it should. Why? I have no idea. I read the rustdoc chapter about it: https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html
but it seems incorrect. For example, I would expect those variants to work and link and render correctly:
[batch::BatchValues]
[`batch::BatchValues`]
but they don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually you will notice that my third commit in this PR removes an occurence of
[]()
because it was rendered incorrectly.
It was not working because []
and ()
were on separate lines (separated by //!
):
//! But the driver will accept anything implementing the trait [SerializeRow]
//! (crate::serialize::row::SerializeRow)
I even checked out locally to see, because at first glance, this looked correct to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. The version after my fix works too, right? At least it did when I checked locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for me it renders correctly as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muzarski do you know why
[batch::BatchValues] [`batch::BatchValues`]
don't work? This of course applies to all the other submodules in this place.
So for me, these do not work in vscode, but render correctly in cargo docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[]()
should work everywhere, so let's just stick to it. It's the ordinary Markdown format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[]()
should work everywhere, so let's just stick to it. It's the ordinary Markdown format.
I'll do it. Still it's sad that this is so difficult to get right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I can change it but both [BatchValues](batch::BatchValues)
and [BatchValues][batch::BatchValues]
are not highlighted in VSCode (and both render corrrectly), so there is no difference.
pub mod serialize { | ||
pub use scylla_cql::types::serialize::*; | ||
pub use scylla_cql::types::serialize::SerializationError; | ||
/// Contains the [BatchValues][batch::BatchValues] and [BatchValuesIterator][batch::BatchValuesIterator] trait and their |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scylla/src/lib.rs
Outdated
}; | ||
} | ||
|
||
/// Contains the [RawBatchValues][raw_batch::RawBatchValues] and [RawBatchValuesIterator][raw_batch::RawBatchValuesIterator] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
}; | ||
} | ||
|
||
/// Contains the [SerializeRow][row::SerializeRow] trait and its implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
pub use scylla_cql::types::serialize::row::{SerializedValues, SerializedValuesIterator}; | ||
} | ||
|
||
/// Contains the [SerializeValue][value::SerializeValue] trait and its implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
It is easier to see what is imported, and decide if it should be, if one can see what exactly is imported. This is hard to do with stars, so, as part of API stabilization effort, those are removed here.
This PR also removes raw_batch re-export. This module should not be needed by users.
I verified using semver-checks that the first commit doesn't introduce any breaking changes.
Pre-review checklist
I added relevant tests for new features and bug fixes.All commits compile, pass static checks and pass test.I have provided docstrings for the public items that I want to introduce.I have adjusted the documentation in./docs/source/
.I added appropriateFixes:
annotations to PR description.