Skip to content

Commit 5af3cc2

Browse files
committed
Fix clippy::while_let_loop
1 parent ac849f8 commit 5af3cc2

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

crates/ra_assists/src/ast_editor.rs

+11-15
Original file line numberDiff line numberDiff line change
@@ -212,21 +212,17 @@ impl AstEditor<ast::FnDef> {
212212
}
213213

214214
pub fn strip_attrs_and_docs(&mut self) {
215-
loop {
216-
if let Some(start) = self
217-
.ast()
218-
.syntax()
219-
.children_with_tokens()
220-
.find(|it| it.kind() == ATTR || it.kind() == COMMENT)
221-
{
222-
let end = match start.next_sibling_or_token() {
223-
Some(el) if el.kind() == WHITESPACE => el,
224-
Some(_) | None => start,
225-
};
226-
self.ast = self.replace_children(RangeInclusive::new(start, end), iter::empty());
227-
} else {
228-
break;
229-
}
215+
while let Some(start) = self
216+
.ast()
217+
.syntax()
218+
.children_with_tokens()
219+
.find(|it| it.kind() == ATTR || it.kind() == COMMENT)
220+
{
221+
let end = match start.next_sibling_or_token() {
222+
Some(el) if el.kind() == WHITESPACE => el,
223+
Some(_) | None => start,
224+
};
225+
self.ast = self.replace_children(RangeInclusive::new(start, end), iter::empty());
230226
}
231227
}
232228
}

0 commit comments

Comments
 (0)