From b73611c67f645864f425d725bb711a2118921b5e Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Wed, 1 Oct 2025 14:45:08 +0200 Subject: [PATCH] refactor: replace `static_assert!` with std `assert!` (#1112) --- src/message/header/mod.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/message/header/mod.rs b/src/message/header/mod.rs index 89ae3b1..c8eaac1 100644 --- a/src/message/header/mod.rs +++ b/src/message/header/mod.rs @@ -186,21 +186,15 @@ impl HeaderName { /// Creates a new header name, panics on invalid name pub const fn new_from_ascii_str(ascii: &'static str) -> Self { - macro_rules! static_assert { - ($condition:expr) => { - let _ = [()][(!($condition)) as usize]; - }; - } - - static_assert!(!ascii.is_empty()); - static_assert!(ascii.len() <= 76); + assert!(!ascii.is_empty()); + assert!(ascii.len() <= 76); + assert!(ascii.is_ascii()); let bytes = ascii.as_bytes(); let mut i = 0; while i < bytes.len() { - static_assert!(bytes[i].is_ascii()); - static_assert!(bytes[i] != b' '); - static_assert!(bytes[i] != b':'); + assert!(bytes[i] != b' '); + assert!(bytes[i] != b':'); i += 1; }