Skip to content

Commit

Permalink
edition tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Aug 25, 2024
1 parent 56a62ac commit e6146ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
3 changes: 1 addition & 2 deletions mavlink-bindgen/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,9 +1107,8 @@ pub fn parse_profile(

assert!(
is_valid_parent(stack.last().copied(), id),
"not valid parent {:?} of {:?}",
"not valid parent {:?} of {id:?}",
stack.last(),
id
);

match id {
Expand Down
3 changes: 1 addition & 2 deletions mavlink-core/src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ impl<'a> Bytes<'a> {
fn check_remaining(&self, count: usize) {
assert!(
self.remaining() >= count,
"read buffer exhausted; remaining {} bytes, try read {} bytes",
"read buffer exhausted; remaining {} bytes, try read {count} bytes",
self.remaining(),
count
);
}

Expand Down
15 changes: 4 additions & 11 deletions mavlink-core/src/bytes_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ impl<'a> BytesMut<'a> {
fn check_remaining(&self, count: usize) {
assert!(
self.remaining() >= count,
"write buffer overflow; remaining {} bytes, try add {} bytes",
"write buffer overflow; remaining {} bytes, try add {count} bytes",
self.remaining(),
count
);
}

Expand Down Expand Up @@ -87,9 +86,7 @@ impl<'a> BytesMut<'a> {
assert!(
val <= MAX,
"Attempted to put value that is too large for 24 bits, \
attempted to push: {}, max allowed: {}",
val,
MAX
attempted to push: {val}, max allowed: {MAX}",
);

let src = val.to_le_bytes();
Expand All @@ -106,16 +103,12 @@ impl<'a> BytesMut<'a> {
assert!(
val <= MAX,
"Attempted to put value that is too large for 24 bits, \
attempted to push: {}, max allowed: {}",
val,
MAX
attempted to push: {val}, max allowed: {MAX}",
);
assert!(
val >= MIN,
"Attempted to put value that is too negative for 24 bits, \
attempted to push: {}, min allowed: {}",
val,
MIN
attempted to push: {val}, min allowed: {MIN}",
);

let src = val.to_le_bytes();
Expand Down

0 comments on commit e6146ea

Please sign in to comment.