Rollup merge of #90742 - est31:add_assign, r=davidtwco

Use AddAssign impl
This commit is contained in:
Matthias Krüger 2021-11-10 18:52:29 +01:00 committed by GitHub
commit 0a9c1be100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ pub fn gather_comments(sm: &SourceMap, path: FileName, src: String) -> Vec<Comme
if let Some(mut idx) = token_text.find('\n') {
code_to_the_left = false;
while let Some(next_newline) = &token_text[idx + 1..].find('\n') {
idx = idx + 1 + next_newline;
idx += 1 + next_newline;
comments.push(Comment {
style: CommentStyle::BlankLine,
lines: vec![],

View File

@ -34,7 +34,7 @@ pub fn record_time<T, F>(accu: &Lock<Duration>, f: F) -> T
let rv = f();
let duration = start.elapsed();
let mut accu = accu.lock();
*accu = *accu + duration;
*accu += duration;
rv
}