mirror of
https://github.com/openharmony/third_party_rust_static-assertions-rs.git
synced 2026-07-19 16:53:36 -04:00
Use fn instead of mod for global assert_eq_size
A function can be used in more places than a module, providing much more flexibility.
This commit is contained in:
+2
-4
@@ -173,10 +173,8 @@ macro_rules! assert_eq_size {
|
||||
}
|
||||
};
|
||||
($label:ident; $x:ty, $($xs:ty),+) => {
|
||||
#[allow(non_snake_case)]
|
||||
mod $label {
|
||||
fn _impl() { assert_eq_size!($x, $($xs),+) }
|
||||
}
|
||||
#[allow(dead_code, non_snake_case)]
|
||||
fn $label() { assert_eq_size!($x, $($xs),+) }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user