aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor/src/line_index.rs
diff options
context:
space:
mode:
authorAlan Du <[email protected]>2018-10-16 16:51:58 +0100
committerAlan Du <[email protected]>2018-10-18 00:42:23 +0100
commitd493a4476c2059924d032fbf01dda091601f9667 (patch)
tree74c1249cba67c8c9824e618fcdea53b97b571a7b /crates/ra_editor/src/line_index.rs
parent5db663d61fb8b006e3b84ef3bcc9cddbe94e5f49 (diff)
clippy: Use if lets and remove redundant returns
Diffstat (limited to 'crates/ra_editor/src/line_index.rs')
-rw-r--r--crates/ra_editor/src/line_index.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_editor/src/line_index.rs b/crates/ra_editor/src/line_index.rs
index da0f2a7f7..9abbb0d09 100644
--- a/crates/ra_editor/src/line_index.rs
+++ b/crates/ra_editor/src/line_index.rs
@@ -29,10 +29,10 @@ impl LineIndex {
29 let line = self.newlines.upper_bound(&offset) - 1; 29 let line = self.newlines.upper_bound(&offset) - 1;
30 let line_start_offset = self.newlines[line]; 30 let line_start_offset = self.newlines[line];
31 let col = offset - line_start_offset; 31 let col = offset - line_start_offset;
32 return LineCol { 32 LineCol {
33 line: line as u32, 33 line: line as u32,
34 col, 34 col,
35 }; 35 }
36 } 36 }
37 37
38 pub fn offset(&self, line_col: LineCol) -> TextUnit { 38 pub fn offset(&self, line_col: LineCol) -> TextUnit {