]> git.lizzy.rs Git - rust.git/commitdiff
Improve getting literal representation
authorflip1995 <uwdkn@student.kit.edu>
Sat, 3 Mar 2018 20:55:04 +0000 (21:55 +0100)
committerflip1995 <uwdkn@student.kit.edu>
Sat, 3 Mar 2018 20:55:04 +0000 (21:55 +0100)
src/librustc_lint/types.rs

index 02aef271c37db2d916830fb4d7f762c021923ea1..e778b2d38610512e2155b91aca98a00f6a7d172d 100644 (file)
@@ -368,7 +368,7 @@ fn get_bin_hex_repr(cx: &LateContext, lit: &ast::Lit) -> Option<String> {
             let src = cx.sess().codemap().span_to_snippet(lit.span).ok()?;
             let firstch = src.chars().next()?;
 
-            if let Some(0) = char::to_digit(firstch, 10) {
+            if firstch == '0' {
                 match src.chars().nth(1) {
                     Some('x') | Some('b') => return Some(src),
                     _ => return None,