Skip to content

Commit

Permalink
Merge pull request #42 from aobatact/master
Browse files Browse the repository at this point in the history
Mark Integer::divides as deprecated.
  • Loading branch information
cuviper authored Feb 8, 2024
2 parents 77324ee + 736ec84 commit 3ac8866
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
}

/// Deprecated, use `is_multiple_of` instead.
fn divides(&self, other: &Self) -> bool;
#[deprecated(note = "Please use is_multiple_of instead")]
#[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 @@ -559,12 +563,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 @@ -926,12 +924,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 3ac8866

Please sign in to comment.