Skip to content

Commit 3ac8866

Browse files
authored
Merge pull request rust-num#42 from aobatact/master
Mark Integer::divides as deprecated.
2 parents 77324ee + 736ec84 commit 3ac8866

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

Diff for: src/lib.rs

+5-13
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
201201
}
202202

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

206210
/// Returns `true` if `self` is a multiple of `other`.
207211
///
@@ -559,12 +563,6 @@ macro_rules! impl_integer_for_isize {
559563
(gcd, lcm)
560564
}
561565

562-
/// Deprecated, use `is_multiple_of` instead.
563-
#[inline]
564-
fn divides(&self, other: &Self) -> bool {
565-
self.is_multiple_of(other)
566-
}
567-
568566
/// Returns `true` if the number is a multiple of `other`.
569567
#[inline]
570568
fn is_multiple_of(&self, other: &Self) -> bool {
@@ -926,12 +924,6 @@ macro_rules! impl_integer_for_usize {
926924
(gcd, lcm)
927925
}
928926

929-
/// Deprecated, use `is_multiple_of` instead.
930-
#[inline]
931-
fn divides(&self, other: &Self) -> bool {
932-
self.is_multiple_of(other)
933-
}
934-
935927
/// Returns `true` if the number is a multiple of `other`.
936928
#[inline]
937929
fn is_multiple_of(&self, other: &Self) -> bool {

0 commit comments

Comments
 (0)