Skip to content

Commit

Permalink
Improve getting literal representation
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Mar 3, 2018
1 parent 15ecf06 commit fc33b25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_lint/types.rs
Expand Up @@ -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,
Expand Down

0 comments on commit fc33b25

Please sign in to comment.