-
Notifications
You must be signed in to change notification settings - Fork 134
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
fix: export RawElement type #461
Conversation
Yup :) Isabel's taking a look at this. |
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.
src/raw/iter.rs
Outdated
@@ -145,6 +145,10 @@ impl<'a> TryInto<Bson> for RawElement<'a> { | |||
} | |||
|
|||
impl<'a> RawElement<'a> { | |||
pub fn is_empty(&self) -> bool { |
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.
Thanks for catching this clippy error! I think it would make more sense to call the len
method size
since it's exposing the number of bytes in the element. That would remove the need to have this is_empty
method, which likely won't have any utility for the users of this type.
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.
I'm fine with that if you are. I think it is technically API breaking because you could have called the len()
method before even though the type wasn't exported.
I don't care, but you might.
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 that's a great point, in that case I think we'll want to stick to len
for the name and change it with the next major release (RUST-1869). I still don't think it makes that much sense to have an is_empty
method, so I suggest silencing the clippy error with #[allow(clippy::len_without_is_empty)]
. Sorry for all of the back-and-forth here!
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.
done!
This reverts commit 747a7ef.
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.
LGTM!
Missed that exports had to be explicitly re-exported in #449.