From 442992463b952ff8351a04cc5b664f44ea9ac09d Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 11 Nov 2022 11:55:56 -0800 Subject: [PATCH] fix(util): rename `ilog` fns to avoid clash with std (#335) --- util/src/math.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/src/math.rs b/util/src/math.rs index 1c399d15..7d7a3919 100644 --- a/util/src/math.rs +++ b/util/src/math.rs @@ -48,10 +48,10 @@ pub trait Logarithm: Sized { /// Returns the integer logarithm base `base` of `self`, or `None` if it is /// not possible to take the log base `base` of `self`. - fn checked_ilog(self, base: Self) -> Option; + fn checked_log(self, base: Self) -> Option; /// Returns the integer logarithm base `base` of `self`. - fn ilog(self, base: Self) -> Self; + fn log(self, base: Self) -> Self; } impl Logarithm for usize { @@ -72,15 +72,15 @@ impl Logarithm for usize { #[inline(always)] #[must_use = "this returns the result of the operation, \ without modifying the original"] - fn checked_ilog(self, base: usize) -> Option { + fn checked_log(self, base: usize) -> Option { usize_const_checked_log(self, base) } #[inline(always)] #[must_use = "this returns the result of the operation, \ without modifying the original"] - fn ilog(self, base: usize) -> Self { - match self.checked_ilog(base) { + fn log(self, base: usize) -> Self { + match self.checked_log(base) { Some(log) => log, None => panic!("cannot take log base {} of {}", base, self), }