mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Apply a few clippy suggestions
This commit is contained in:
parent
e8e14e1b13
commit
3c6dc0f89d
4 changed files with 121 additions and 47 deletions
|
@ -238,14 +238,9 @@ fn extract_line_annotations(mut line: &str) -> Vec<LineAnnotation> {
|
|||
let mut res = Vec::new();
|
||||
let mut offset: TextSize = 0.into();
|
||||
let marker: fn(char) -> bool = if line.contains('^') { |c| c == '^' } else { |c| c == '|' };
|
||||
loop {
|
||||
match line.find(marker) {
|
||||
Some(idx) => {
|
||||
offset += TextSize::try_from(idx).unwrap();
|
||||
line = &line[idx..];
|
||||
}
|
||||
None => break,
|
||||
};
|
||||
while let Some(idx) = line.find(marker) {
|
||||
offset += TextSize::try_from(idx).unwrap();
|
||||
line = &line[idx..];
|
||||
|
||||
let mut len = line.chars().take_while(|&it| it == '^').count();
|
||||
let mut continuation = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue