From 990a79f097e8e74308bfec6d72dcdbb769a7973b Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 4 Jan 2015 01:19:03 +1100 Subject: [PATCH] char: small tweak since `is_some` > equivalent `match`. --- src/libcore/char.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libcore/char.rs b/src/libcore/char.rs index ce530ae1d32..291b7f2ece4 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -198,10 +198,7 @@ pub trait CharExt { impl CharExt for char { #[unstable = "pending integer conventions"] fn is_digit(self, radix: uint) -> bool { - match self.to_digit(radix) { - Some(_) => true, - None => false, - } + self.to_digit(radix).is_some() } #[unstable = "pending integer conventions"]