Skip to content

Commit bc5c865

Browse files
committed
Use more std::array::IntoIter
1 parent 9787bdd commit bc5c865

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/syntax/src/ast/edit.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! immutable, all function here return a fresh copy of the tree, instead of
33
//! doing an in-place modification.
44
use std::{
5-
fmt, iter,
5+
array, fmt, iter,
66
ops::{self, RangeInclusive},
77
};
88

@@ -55,9 +55,8 @@ impl ast::Fn {
5555

5656
let anchor = self.name().expect("The function must have a name").syntax().clone();
5757

58-
let mut to_insert: ArrayVec<SyntaxElement, 1> = ArrayVec::new();
59-
to_insert.push(generic_args.syntax().clone().into());
60-
self.insert_children(InsertPosition::After(anchor.into()), to_insert)
58+
let to_insert = [generic_args.syntax().clone().into()];
59+
self.insert_children(InsertPosition::After(anchor.into()), array::IntoIter::new(to_insert))
6160
}
6261
}
6362

0 commit comments

Comments
 (0)