Skip to content

Commit

Permalink
fix new clippy warning in rust 1.71 (#1358)
Browse files Browse the repository at this point in the history
# Description

@swift-nav/devinfra

Small changes to libsbp rust code to pass clippy

# API compatibility

Does this change introduce a API compatibility risk?

No

## API compatibility plan

N/A

# JIRA Reference

N/A
  • Loading branch information
pcrumley authored Aug 25, 2023
1 parent bce5252 commit 24f3945
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/sbp/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ mod tests {
let timeout_duration = Duration::from_secs(2);
let now = Instant::now();
let mut messages = iter_messages_with_timeout(rdr, timeout_duration);
assert!(matches!(messages.next().unwrap(), Err(Error::IoError(_))));
assert_eq!(messages.next().unwrap(), Err(Error::IoError(_)));

Check failure on line 462 in rust/sbp/src/de.rs

View workflow job for this annotation

GitHub Actions / Format and lint

in expressions, `_` can only be used on the left-hand side of an assignment

Check failure on line 462 in rust/sbp/src/de.rs

View workflow job for this annotation

GitHub Actions / Format and lint

binary operation `==` cannot be applied to type `std::result::Result<messages::Sbp, de::Error>`
assert!(now.elapsed() >= timeout_duration);
}

Expand Down Expand Up @@ -494,7 +494,7 @@ mod tests {
let data = vec![0u8; 1000];
let mut bytes = BytesMut::from(&data[..]);
assert_eq!(bytes.len(), 1000);
assert!(matches!(FramerImpl.decode(&mut bytes).unwrap(), None));
assert_eq!(FramerImpl.decode(&mut bytes).unwrap(), None);

Check failure on line 497 in rust/sbp/src/de.rs

View workflow job for this annotation

GitHub Actions / Format and lint

binary operation `==` cannot be applied to type `std::option::Option<de::Frame>`
}

#[test]
Expand Down Expand Up @@ -583,7 +583,7 @@ mod tests {
let packet: Vec<_> = invalid_message_bytes
.iter()
.cloned()
.chain(valid_message.into_iter())
.chain(valid_message)
.collect();

let mut msgs = iter_messages(Cursor::new(packet));
Expand Down

0 comments on commit 24f3945

Please sign in to comment.