diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-11-10 18:52:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-10 18:52:29 +0100 |
| commit | 0a9c1be1007b8f825632fc451db8be43f781ca65 (patch) | |
| tree | 9d57ec744af94fd585ad2ac2459b25805c034d28 | |
| parent | b31f0198b14300d232dc1b6d1f52dc92da7818ff (diff) | |
| parent | 9afb241af575d2550d6e58b73cb0769a73d6a1f2 (diff) | |
| download | rust-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.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/util/common.rs | 2 |
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 } |
