From fc33b2567cac0ae453807f4118872ab81a16ddf7 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sat, 3 Mar 2018 21:55:04 +0100 Subject: [PATCH] Improve getting literal representation --- src/librustc_lint/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 02aef271c37..e778b2d3861 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -368,7 +368,7 @@ fn get_bin_hex_repr(cx: &LateContext, lit: &ast::Lit) -> Option { 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, -- 2.44.0