about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-11-10 18:52:29 +0100
committerGitHub <noreply@github.com>2021-11-10 18:52:29 +0100
commit0a9c1be1007b8f825632fc451db8be43f781ca65 (patch)
tree9d57ec744af94fd585ad2ac2459b25805c034d28
parentb31f0198b14300d232dc1b6d1f52dc92da7818ff (diff)
parent9afb241af575d2550d6e58b73cb0769a73d6a1f2 (diff)
downloadrust-0a9c1be1007b8f825632fc451db8be43f781ca65.tar.gz
rust-0a9c1be1007b8f825632fc451db8be43f781ca65.zip
Rollup merge of #90742 - est31:add_assign, r=davidtwco
Use AddAssign impl
-rw-r--r--compiler/rustc_ast/src/util/comments.rs2
-rw-r--r--compiler/rustc_middle/src/util/common.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs
index c40aec4b671..80a06fa5943 100644
--- a/compiler/rustc_ast/src/util/comments.rs
+++ b/compiler/rustc_ast/src/util/comments.rs
@@ -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![],
diff --git a/compiler/rustc_middle/src/util/common.rs b/compiler/rustc_middle/src/util/common.rs
index da857b0a403..08977049db0 100644
--- a/compiler/rustc_middle/src/util/common.rs
+++ b/compiler/rustc_middle/src/util/common.rs
@@ -34,7 +34,7 @@ where
     let rv = f();
     let duration = start.elapsed();
     let mut accu = accu.lock();
-    *accu = *accu + duration;
+    *accu += duration;
     rv
 }