mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
clippy: Use if lets and remove redundant returns
This commit is contained in:
parent
5db663d61f
commit
d493a4476c
11 changed files with 22 additions and 29 deletions
|
@ -29,10 +29,10 @@ impl LineIndex {
|
|||
let line = self.newlines.upper_bound(&offset) - 1;
|
||||
let line_start_offset = self.newlines[line];
|
||||
let col = offset - line_start_offset;
|
||||
return LineCol {
|
||||
LineCol {
|
||||
line: line as u32,
|
||||
col,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn offset(&self, line_col: LineCol) -> TextUnit {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue