aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-12-17 09:12:20 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-12-17 10:17:50 +0100
commit3c8f396f21dc75f733ef5eefe99afd0e9e798f40 (patch)
treec58b0f8714320a131251c36888d43c0cf4327ada /src
parent5724b87a1c9fcf66e6205af6732fc07e4c9d909d (diff)
downloadntw-3c8f396f21dc75f733ef5eefe99afd0e9e798f40.tar.gz
ntw-3c8f396f21dc75f733ef5eefe99afd0e9e798f40.tar.bz2
Remove label from assert_maximum_size macro
Since static_assertions 1.0.0, we no longer have to specify a label when calling an assert macro. Therefore we can also remove the label from our own assert macro assert_maximum_size.
Diffstat (limited to 'src')
-rw-r--r--src/commands.rs6
-rw-r--r--src/util.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/commands.rs b/src/commands.rs
index 66851c1..0b4e00f 100644
--- a/src/commands.rs
+++ b/src/commands.rs
@@ -34,7 +34,7 @@ struct GetStatusResponse {
config_delete_user_password: u8,
}
-assert_maximum_size!(GetStatusResponse; GetStatusResponse, crate::device::RESPONSE_DATA_LEN);
+assert_maximum_size!(GetStatusResponse, crate::device::RESPONSE_DATA_LEN);
#[derive(Debug, Default)]
struct GetStatusCommand {}
@@ -55,14 +55,14 @@ struct ReadSlotNameRequest {
internal_slot_number: u8,
}
-assert_maximum_size!(ReadSlotNameRequest; ReadSlotNameRequest, crate::device::REQUEST_DATA_LEN);
+assert_maximum_size!(ReadSlotNameRequest, crate::device::REQUEST_DATA_LEN);
#[derive(Debug, Default, Serialize)]
struct ReadSlotNameResponse {
slot_name: [u8; 15],
}
-assert_maximum_size!(ReadSlotNameResponse; ReadSlotNameResponse, crate::device::RESPONSE_DATA_LEN);
+assert_maximum_size!(ReadSlotNameResponse, crate::device::RESPONSE_DATA_LEN);
#[derive(Debug, Default)]
struct ReadSlotNameCommand {}
diff --git a/src/util.rs b/src/util.rs
index 4539bd6..61bcfe7 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -78,7 +78,7 @@ macro_rules! enum_u8 {
}
macro_rules! assert_maximum_size {
- ($i:ident; $t:ident, $e: expr) => {
+ ($t:ident, $e: expr) => {
::static_assertions::const_assert!(
::core::mem::size_of::<$t>() <= $e
);