Skip to content

Commit 770bc97

Browse files
authored
Merge pull request #565 from asomers/legacy_numeric_constants
Clippy cleanup: legacy_numeric_constants
2 parents 8ce2e92 + 08a905e commit 770bc97

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mockall/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ impl<'a, T> ViaNothing for ArgPrinter<'a, T> {
15091509
}
15101510
}
15111511

1512-
// Though it's not entirely correct, we treat usize::max_value() as
1512+
// Though it's not entirely correct, we treat usize::MAX as
15131513
// approximately infinity.
15141514
#[derive(Debug)]
15151515
#[doc(hidden)]
@@ -1518,7 +1518,7 @@ pub struct TimesRange(Range<usize>);
15181518
impl Default for TimesRange {
15191519
fn default() -> TimesRange {
15201520
// By default, allow any number of calls
1521-
TimesRange(0..usize::max_value())
1521+
TimesRange(0..usize::MAX)
15221522
}
15231523
}
15241524

@@ -1537,13 +1537,13 @@ impl From<Range<usize>> for TimesRange {
15371537

15381538
impl From<RangeFrom<usize>> for TimesRange {
15391539
fn from(r: RangeFrom<usize>) -> TimesRange {
1540-
TimesRange(r.start..usize::max_value())
1540+
TimesRange(r.start..usize::MAX)
15411541
}
15421542
}
15431543

15441544
impl From<RangeFull> for TimesRange {
15451545
fn from(_: RangeFull) -> TimesRange {
1546-
TimesRange(0..usize::max_value())
1546+
TimesRange(0..usize::MAX)
15471547
}
15481548
}
15491549

@@ -1602,7 +1602,7 @@ impl Times {
16021602
}
16031603

16041604
pub fn any(&mut self) {
1605-
self.range.0 = 0..usize::max_value();
1605+
self.range.0 = 0..usize::MAX;
16061606
}
16071607

16081608
/// Return how many times this expectation has been called

mockall/tests/mock_refmut_arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ fn static_mut() {
4747
.withf(|x| *x == 5)
4848
.returning(|x| { *x = 42;} );
4949
// Safe because mock leaves scope before x
50-
unsafe { mock.bar(mem::transmute(&mut x)); }
50+
unsafe { mock.bar(mem::transmute::<&mut u32, &mut u32>(&mut x)); }
5151
assert_eq!(x, 42);
5252
}

0 commit comments

Comments
 (0)