diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-05 17:07:11 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-05 17:07:11 +0100 |
commit | feae74e02c4ed0a134b6d3f18dd5d79baff85c3d (patch) | |
tree | facf2c398e8dd428225a84455437abf81a478ee0 /crates/ra_ide_api/src/line_index_utils.rs | |
parent | ec6f71576ace170fd306a68f77e5c5e9646d15be (diff) | |
parent | 001e34e6e31503195d176a349bc9476681c79e7f (diff) |
Merge #1493
1493: Clippy trivially_copy_pass_by_ref r=matklad a=kjeremy
Clippy says that this is more efficient.
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/line_index_utils.rs')
-rw-r--r-- | crates/ra_ide_api/src/line_index_utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/line_index_utils.rs b/crates/ra_ide_api/src/line_index_utils.rs index 8f63db5f1..534009b98 100644 --- a/crates/ra_ide_api/src/line_index_utils.rs +++ b/crates/ra_ide_api/src/line_index_utils.rs | |||
@@ -213,7 +213,7 @@ impl RunningLineCol { | |||
213 | self.col_adjust = TextUnit::from(0); | 213 | self.col_adjust = TextUnit::from(0); |
214 | } | 214 | } |
215 | 215 | ||
216 | fn adjust_col(&mut self, range: &TextRange) { | 216 | fn adjust_col(&mut self, range: TextRange) { |
217 | self.col_adjust += range.len() - TextUnit::from(1); | 217 | self.col_adjust += range.len() - TextUnit::from(1); |
218 | } | 218 | } |
219 | } | 219 | } |
@@ -244,7 +244,7 @@ pub fn translate_offset_with_edit( | |||
244 | let clamp = offset.min(x.start()); | 244 | let clamp = offset.min(x.start()); |
245 | return res.to_line_col(clamp); | 245 | return res.to_line_col(clamp); |
246 | } else { | 246 | } else { |
247 | res.adjust_col(x); | 247 | res.adjust_col(*x); |
248 | } | 248 | } |
249 | } | 249 | } |
250 | } | 250 | } |