Skip to content

Commit edf5503

Browse files
committed
fix: update If! for the latest compiler version
This commit addresses the following error: error: expressions must be enclosed in braces to be used as const generic arguments --> src/r3/src/utils/int.rs:9:9 | 9 | if (MAX <= u8::MAX as u128) { | ^^^
1 parent 757acb2 commit edf5503

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/r3/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use core::marker::PhantomData;
77
/// Conditional type
88
macro_rules! If {
99
( if ($cond:expr) { $t:ty } else { $f:ty } ) => {
10-
<crate::utils::Conditional<$t, $f, $cond> as crate::utils::TypeFn>::Output
10+
<crate::utils::Conditional<$t, $f, {$cond}> as crate::utils::TypeFn>::Output
1111
};
1212
( if ($cond:expr) { $t:ty } else if $($rest:tt)* ) => {
1313
If! { if ($cond) { $t } else { If!{ if $($rest)* } } }

src/r3_portkit/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub use r3::utils::Init;
1010
/// Conditional type
1111
macro_rules! If {
1212
( if ($cond:expr) { $t:ty } else { $f:ty } ) => {
13-
<crate::utils::Conditional<$t, $f, $cond> as crate::utils::TypeFn>::Output
13+
<crate::utils::Conditional<$t, $f, {$cond}> as crate::utils::TypeFn>::Output
1414
};
1515
( if ($cond:expr) { $t:ty } else if $($rest:tt)* ) => {
1616
If! { if ($cond) { $t } else { If!{ if $($rest)* } } }

0 commit comments

Comments
 (0)