Skip to content

Commit 736ec84

Browse files
committed
Add default fallback from divides to is_multiple_of
1 parent a51b3ff commit 736ec84

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

Diff for: src/lib.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
202202

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

207210
/// Returns `true` if `self` is a multiple of `other`.
208211
///
@@ -526,12 +529,6 @@ macro_rules! impl_integer_for_isize {
526529
(gcd, lcm)
527530
}
528531

529-
/// Deprecated, use `is_multiple_of` instead.
530-
#[inline]
531-
fn divides(&self, other: &Self) -> bool {
532-
self.is_multiple_of(other)
533-
}
534-
535532
/// Returns `true` if the number is a multiple of `other`.
536533
#[inline]
537534
fn is_multiple_of(&self, other: &Self) -> bool {
@@ -893,12 +890,6 @@ macro_rules! impl_integer_for_usize {
893890
(gcd, lcm)
894891
}
895892

896-
/// Deprecated, use `is_multiple_of` instead.
897-
#[inline]
898-
fn divides(&self, other: &Self) -> bool {
899-
self.is_multiple_of(other)
900-
}
901-
902893
/// Returns `true` if the number is a multiple of `other`.
903894
#[inline]
904895
fn is_multiple_of(&self, other: &Self) -> bool {

0 commit comments

Comments
 (0)