Skip to content

Commit 6d26869

Browse files
refactor: replace internal const_assert! with std assert!
1 parent 21bc237 commit 6d26869

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/secure/key.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const COMBINED_KEY_LENGTH: usize = SIGNING_KEY_LEN + ENCRYPTION_KEY_LEN;
44

55
// Statically ensure the numbers above are in-sync.
66
#[cfg(feature = "signed")]
7-
const_assert!(crate::secure::signed::KEY_LEN == SIGNING_KEY_LEN);
7+
const _: () = assert!(crate::secure::signed::KEY_LEN == SIGNING_KEY_LEN);
88
#[cfg(feature = "private")]
9-
const_assert!(crate::secure::private::KEY_LEN == ENCRYPTION_KEY_LEN);
9+
const _: () = assert!(crate::secure::private::KEY_LEN == ENCRYPTION_KEY_LEN);
1010

1111
/// A cryptographic master key for use with `Signed` and/or `Private` jars.
1212
///

src/secure/macros.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,3 @@ macro_rules! assert_secure_behaviour {
3838
assert!($secure.get("secure").is_none());
3939
}};
4040
}
41-
42-
// This is courtesty of `static_assertions`. That library is Copyright (c) 2017
43-
// Nikolai Vazquez. See https://github.com/nvzqz/static-assertions-rs for more.
44-
macro_rules! const_assert {
45-
($x:expr $(,)?) => {
46-
#[allow(unknown_lints, clippy::eq_op)]
47-
const _: [(); 0 - !{
48-
const ASSERT: bool = $x;
49-
ASSERT
50-
} as usize] = [];
51-
};
52-
}

0 commit comments

Comments
 (0)