File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,7 @@ pub(crate) fn fill_match_arms(ctx: AssistCtx) -> Option<Assist> {
97
97
}
98
98
99
99
ctx. add_assist ( AssistId ( "fill_match_arms" ) , "Fill match arms" , |edit| {
100
- let new_arm_list =
101
- match_arm_list. remove_placeholder ( ) . append_arms ( missing_arms. into_iter ( ) ) ;
100
+ let new_arm_list = match_arm_list. remove_placeholder ( ) . append_arms ( missing_arms) ;
102
101
103
102
edit. target ( match_expr. syntax ( ) . text_range ( ) ) ;
104
103
edit. set_cursor ( expr. syntax ( ) . text_range ( ) . start ( ) ) ;
Original file line number Diff line number Diff line change @@ -80,12 +80,12 @@ where
80
80
81
81
impl ast:: ItemList {
82
82
#[ must_use]
83
- pub fn append_items ( & self , items : impl Iterator < Item = ast:: ImplItem > ) -> ast:: ItemList {
83
+ pub fn append_items ( & self , items : impl IntoIterator < Item = ast:: ImplItem > ) -> ast:: ItemList {
84
84
let mut res = self . clone ( ) ;
85
85
if !self . syntax ( ) . text ( ) . contains_char ( '\n' ) {
86
86
res = make_multiline ( res) ;
87
87
}
88
- items. for_each ( |it| res = res. append_item ( it) ) ;
88
+ items. into_iter ( ) . for_each ( |it| res = res. append_item ( it) ) ;
89
89
res
90
90
}
91
91
@@ -339,13 +339,13 @@ impl ast::UseTree {
339
339
340
340
impl ast:: MatchArmList {
341
341
#[ must_use]
342
- pub fn append_arms ( & self , items : impl Iterator < Item = ast:: MatchArm > ) -> ast:: MatchArmList {
342
+ pub fn append_arms ( & self , items : impl IntoIterator < Item = ast:: MatchArm > ) -> ast:: MatchArmList {
343
343
let mut res = self . clone ( ) ;
344
344
res = res. strip_if_only_whitespace ( ) ;
345
345
if !res. syntax ( ) . text ( ) . contains_char ( '\n' ) {
346
346
res = make_multiline ( res) ;
347
347
}
348
- items. for_each ( |it| res = res. append_arm ( it) ) ;
348
+ items. into_iter ( ) . for_each ( |it| res = res. append_arm ( it) ) ;
349
349
res
350
350
}
351
351
You can’t perform that action at this time.
0 commit comments