use usize::from

Co-Authored-By: Mateusz Mikuła <mati865@users.noreply.github.com>
This commit is contained in:
lzutao 2019-11-19 23:47:18 +07:00 committed by GitHub
parent 4da0da9281
commit d229d91d88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringLitAsBytes {
if let LitKind::Str(ref lit_content, style) = lit.node {
let callsite = snippet(cx, args[0].span.source_callsite(), r#""foo""#);
let expanded = if let StrStyle::Raw(n) = style {
let term = "#".repeat(n as usize);
let term = "#".repeat(usize::from(n));
format!("r{0}\"{1}\"{0}", term, lit_content.as_str())
} else {
format!("\"{}\"", lit_content.as_str())