Skip to content

Commit

Permalink
fix: update If! for the latest compiler version
Browse files Browse the repository at this point in the history
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) {
      |         ^^^
  • Loading branch information
yvt committed Dec 4, 2020
1 parent 757acb2 commit edf5503
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/r3/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use core::marker::PhantomData;
/// Conditional type
macro_rules! If {
( if ($cond:expr) { $t:ty } else { $f:ty } ) => {
<crate::utils::Conditional<$t, $f, $cond> as crate::utils::TypeFn>::Output
<crate::utils::Conditional<$t, $f, {$cond}> as crate::utils::TypeFn>::Output
};
( if ($cond:expr) { $t:ty } else if $($rest:tt)* ) => {
If! { if ($cond) { $t } else { If!{ if $($rest)* } } }
Expand Down
2 changes: 1 addition & 1 deletion src/r3_portkit/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use r3::utils::Init;
/// Conditional type
macro_rules! If {
( if ($cond:expr) { $t:ty } else { $f:ty } ) => {
<crate::utils::Conditional<$t, $f, $cond> as crate::utils::TypeFn>::Output
<crate::utils::Conditional<$t, $f, {$cond}> as crate::utils::TypeFn>::Output
};
( if ($cond:expr) { $t:ty } else if $($rest:tt)* ) => {
If! { if ($cond) { $t } else { If!{ if $($rest)* } } }
Expand Down

0 comments on commit edf5503

Please sign in to comment.