about summary refs log tree commit diff
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2021-11-09 23:45:17 +0100
committerest31 <MTest31@outlook.com>2021-11-09 23:47:36 +0100
commit9afb241af575d2550d6e58b73cb0769a73d6a1f2 (patch)
treeccae1dd3884fb6917edda2f6f7cd90f049af38bd
parentd32993afe81a49701edd6f2b8f018020ca50da1a (diff)
downloadrust-9afb241af575d2550d6e58b73cb0769a73d6a1f2.tar.gz
rust-9afb241af575d2550d6e58b73cb0769a73d6a1f2.zip
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 542a330a031..02792f09ace 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
 }