Skip to content

Commit

Permalink
move to 2021 edition (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades authored Aug 25, 2024
1 parent 8fb5875 commit 2ab6785
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ num-traits = { version = "0.2", default-features = false }
num-derive = "0.3.2"
bitflags = "1.2.1"
byteorder = { version = "1.3.4", default-features = false }

[workspace.package]
edition = "2021"
2 changes: 1 addition & 1 deletion mavlink-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mavlink-bindgen"
version = "0.13.2"
edition = "2021"
edition.workspace = true
license = "MIT/Apache-2.0"
description = "Library used by rust-mavlink."
readme = "README.md"
Expand Down
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
2 changes: 1 addition & 1 deletion mavlink-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description = "Implements the MAVLink data interchange format for UAVs."
readme = "../README.md"
license = "MIT/Apache-2.0"
repository = "https://github.com/mavlink/rust-mavlink"
edition = "2018"
edition.workspace = true
rust-version = "1.65.0"

[dependencies]
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
2 changes: 1 addition & 1 deletion mavlink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description = "Implements the MAVLink data interchange format for UAVs."
readme = "../README.md"
license = "MIT/Apache-2.0"
repository = "https://github.com/mavlink/rust-mavlink"
edition = "2018"
edition.workspace = true
rust-version = "1.65.0"

[build-dependencies]
Expand Down

0 comments on commit 2ab6785

Please sign in to comment.