Skip to content
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 warning in rust 1.71 #1358

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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 @@
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
Loading