Skip to content

Commit dd74533

Browse files
committed
Split impl_numbers.
The current macro structure is odd, handling the plural case by falling through the singular cases. This commit splits it in two, making it simpler and clearer.
1 parent eb73a89 commit dd74533

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

crates/spirv-std/src/integer.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ pub trait SignedInteger: Integer {}
1818
pub trait UnsignedInteger: Integer {}
1919

2020
macro_rules! impl_numbers {
21+
($(impl $trait:ident for $typ:ty;)+) => {
22+
$(impl_number!(impl $trait for $typ;);)+
23+
};
24+
}
25+
26+
macro_rules! impl_number {
2127
(impl UnsignedInteger for $typ:ty;) => {
2228
unsafe impl Integer for $typ {
2329
const WIDTH: usize = core::mem::size_of::<$typ>() * 8;
@@ -34,10 +40,6 @@ macro_rules! impl_numbers {
3440

3541
impl SignedInteger for $typ {}
3642
};
37-
($(impl $trait:ident for $typ:ty;)+) => {
38-
$(impl_numbers!(impl $trait for $typ;);)+
39-
};
40-
4143
}
4244

4345
impl_numbers! {

0 commit comments

Comments
 (0)