Hint type for .sum()

This commit is contained in:
AnthonyMikh 2019-10-01 03:04:01 +03:00 committed by GitHub
parent 515262cc13
commit fdce4168fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1526,7 +1526,7 @@ impl EmitterWriter {
// length of the code after substitution
let full_sub_len = part.snippet.chars()
.map(|ch| unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1))
.sum() as isize;
.sum::<usize>() as isize;
// length of the code to be substituted
let snippet_len = span_end_pos as isize - span_start_pos as isize;