Skip to content

Commit

Permalink
Add default fallback from divides to is_multiple_of
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Feb 8, 2024
1 parent a51b3ff commit 736ec84
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {

/// Deprecated, use `is_multiple_of` instead.
#[deprecated(note = "Please use is_multiple_of instead")]
fn divides(&self, other: &Self) -> bool;
#[inline]
fn divides(&self, other: &Self) -> bool {
self.is_multiple_of(other)
}

/// Returns `true` if `self` is a multiple of `other`.
///
Expand Down Expand Up @@ -526,12 +529,6 @@ macro_rules! impl_integer_for_isize {
(gcd, lcm)
}

/// Deprecated, use `is_multiple_of` instead.
#[inline]
fn divides(&self, other: &Self) -> bool {
self.is_multiple_of(other)
}

/// Returns `true` if the number is a multiple of `other`.
#[inline]
fn is_multiple_of(&self, other: &Self) -> bool {
Expand Down Expand Up @@ -893,12 +890,6 @@ macro_rules! impl_integer_for_usize {
(gcd, lcm)
}

/// Deprecated, use `is_multiple_of` instead.
#[inline]
fn divides(&self, other: &Self) -> bool {
self.is_multiple_of(other)
}

/// Returns `true` if the number is a multiple of `other`.
#[inline]
fn is_multiple_of(&self, other: &Self) -> bool {
Expand Down

0 comments on commit 736ec84

Please sign in to comment.