File tree 1 file changed +11
-15
lines changed
1 file changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -212,21 +212,17 @@ impl AstEditor<ast::FnDef> {
212
212
}
213
213
214
214
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 ( ) ) ;
230
226
}
231
227
}
232
228
}
You can’t perform that action at this time.
0 commit comments