From 5fd98b3d795e11a27ba8f8b5d3d7b3418a12c2f8 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 16 Oct 2015 13:45:18 -0700 Subject: [PATCH] `other` should be called `other`, not `v`. --- src/libcore/num/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 8b005b2f8ba7e..4b68591aa86a3 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -404,12 +404,12 @@ macro_rules! int_impl { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[inline] - pub fn checked_div(self, v: Self) -> Option { - match v { - 0 => None, + pub fn checked_div(self, other: Self) -> Option { + match other { + 0 => None, -1 if self == Self::min_value() - => None, - v => Some(self / v), + => None, + other => Some(self / other), } } @@ -973,10 +973,10 @@ macro_rules! uint_impl { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[inline] - pub fn checked_div(self, v: Self) -> Option { - match v { + pub fn checked_div(self, other: Self) -> Option { + match other { 0 => None, - v => Some(self / v), + other => Some(self / other), } }