Skip to content

Commit 78485d8

Browse files
committed
fix(util): rename ilog fns to avoid clash with std (#335)
1 parent dc5a9d6 commit 78485d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

util/src/math.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ pub trait Logarithm: Sized {
4848

4949
/// Returns the integer logarithm base `base` of `self`, or `None` if it is
5050
/// not possible to take the log base `base` of `self`.
51-
fn checked_ilog(self, base: Self) -> Option<Self>;
51+
fn checked_log(self, base: Self) -> Option<Self>;
5252

5353
/// Returns the integer logarithm base `base` of `self`.
54-
fn ilog(self, base: Self) -> Self;
54+
fn log(self, base: Self) -> Self;
5555
}
5656

5757
impl Logarithm for usize {
@@ -72,15 +72,15 @@ impl Logarithm for usize {
7272
#[inline(always)]
7373
#[must_use = "this returns the result of the operation, \
7474
without modifying the original"]
75-
fn checked_ilog(self, base: usize) -> Option<Self> {
75+
fn checked_log(self, base: usize) -> Option<Self> {
7676
usize_const_checked_log(self, base)
7777
}
7878

7979
#[inline(always)]
8080
#[must_use = "this returns the result of the operation, \
8181
without modifying the original"]
82-
fn ilog(self, base: usize) -> Self {
83-
match self.checked_ilog(base) {
82+
fn log(self, base: usize) -> Self {
83+
match self.checked_log(base) {
8484
Some(log) => log,
8585
None => panic!("cannot take log base {} of {}", base, self),
8686
}

0 commit comments

Comments
 (0)