-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 new clippy lints #2429
Fix new clippy lints #2429
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ pub trait FromBytes { | |
} | ||
} | ||
|
||
pub struct ToBytesSerializer<T: ToBytes>(String, Option<usize>, PhantomData<T>); | ||
pub struct ToBytesSerializer<T: ToBytes>(PhantomData<T>); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you maybe share intuition or the clippy lint which led to these suggestions? The change ot There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
impl<T: ToBytes> ToBytesSerializer<T> { | ||
/// Serializes a static-sized object as a byte array (without length encoding). | ||
|
@@ -100,7 +100,7 @@ impl<T: ToBytes> ToBytesSerializer<T> { | |
} | ||
} | ||
|
||
pub struct FromBytesDeserializer<T: FromBytes>(String, Option<usize>, PhantomData<T>); | ||
pub struct FromBytesDeserializer<T: FromBytes>(PhantomData<T>); | ||
|
||
impl<'de, T: FromBytes> FromBytesDeserializer<T> { | ||
/// Deserializes a static-sized byte array (without length encoding). | ||
|
@@ -166,12 +166,12 @@ impl<'de, T: FromBytes> FromBytesDeserializer<T> { | |
} | ||
} | ||
|
||
pub struct FromBytesVisitor<'a>(&'a mut Vec<u8>, SmolStr, Option<usize>); | ||
pub struct FromBytesVisitor<'a>(&'a mut Vec<u8>, SmolStr); | ||
|
||
impl<'a> FromBytesVisitor<'a> { | ||
/// Initializes a new `FromBytesVisitor` with the given `buffer` and `name`. | ||
pub fn new(buffer: &'a mut Vec<u8>, name: &str) -> Self { | ||
Self(buffer, SmolStr::new(name), None) | ||
Self(buffer, SmolStr::new(name)) | ||
} | ||
} | ||
|
||
|
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.
we do want
swap_remove
here, because right after this loop weensure
that thefuture_registers
is empty, meaning the order is no longer significantThere 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.
@d0cd @evan-schott can you confirm
swap_remove
is the intended behavior? (i understand it was technically swap_remove, want to ensure it truly shouldn't be shift_remove)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.
Confirmed that
swap_remove
is intended since we do not rely on the order offuture_registers
after the removes are done.