Skip to content

Commit

Permalink
handle new clippy lints (#1364)
Browse files Browse the repository at this point in the history
# Description

@swift-nav/devinfra

Small cleanup to unbreak CI

# API compatibility

Does this change introduce a API compatibility risk?

No, simply a code hygiene change.

# JIRA Reference

N/A
  • Loading branch information
pcrumley authored Oct 19, 2023
1 parent 0bfe6c6 commit e120721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/sbp/src/sbp_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<T: AsRef<[u8]>> SbpString<T, Unterminated> {
impl<T: AsRef<[u8]>> SbpString<T, NullTerminated> {
pub fn null_terminated(data: T) -> Result<Self, NullTerminatedError> {
match data.as_ref().last() {
Some(l) if l == &0 => Ok(Self::new(data)),
Some(&0) => Ok(Self::new(data)),
_ => Err(NullTerminatedError),
}
}
Expand Down Expand Up @@ -79,7 +79,7 @@ impl SbpString<Vec<u8>, Multipart> {
pub fn multipart(data: impl Into<Vec<u8>>) -> Result<Self, MultipartError> {
let data = data.into();
match data.last() {
Some(l) if l == &0 => Ok(Self::new(data)),
Some(&0) => Ok(Self::new(data)),
_ => Err(MultipartError),
}
}
Expand Down

0 comments on commit e120721

Please sign in to comment.