Skip to content
Snippets Groups Projects
Unverified Commit 2ab67858 authored by danieleades's avatar danieleades Committed by GitHub
Browse files

move to 2021 edition (#262)

parent 8fb58753
Branches
Tags
No related merge requests found
......@@ -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"
[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"
......
......@@ -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 {
......
......@@ -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]
......
......@@ -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
);
}
......
......@@ -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
);
}
......@@ -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();
......@@ -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();
......
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment