Skip to content

Commit 43b1c15

Browse files
committed
unbreak on older Rust
1 parent 2200568 commit 43b1c15

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/power.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use traits::Zero;
1+
use traits::{Zero, checked_pow};
22

33
use Integer;
44

@@ -106,13 +106,14 @@ macro_rules! impl_Power {
106106
fn checked_next_power_of(&self, other: &Self) -> Option<Self> {
107107
self.checked_sub(1)
108108
.map_or(Some(1), |new|
109-
traits::checked_pow(*other,
110-
new.checked_log(other)
111-
.map_or(0, |a| a as Self + 1) as usize))
109+
checked_pow(*other, new.checked_log(other)
110+
.map_or(0, |a| a as Self + 1) as usize))
112111
}
113112
});
114113

115114
($($t:ty),*) => { $(impl_Power!($t);)* };
116115
}
117116

118-
impl_Power!(usize, u8, u16, u32, u64, u128);
117+
impl_Power!(usize, u8, u16, u32, u64);
118+
#[cfg(has_i128)]
119+
impl_Power!(u128);

0 commit comments

Comments
 (0)