Improve getting literal representation

This commit is contained in:
flip1995 2018-03-03 21:55:04 +01:00
parent 15ecf06948
commit fc33b2567c

View File

@ -368,7 +368,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
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,