We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9787bdd commit bc5c865Copy full SHA for bc5c865
crates/syntax/src/ast/edit.rs
@@ -2,7 +2,7 @@
2
//! immutable, all function here return a fresh copy of the tree, instead of
3
//! doing an in-place modification.
4
use std::{
5
- fmt, iter,
+ array, fmt, iter,
6
ops::{self, RangeInclusive},
7
};
8
@@ -55,9 +55,8 @@ impl ast::Fn {
55
56
let anchor = self.name().expect("The function must have a name").syntax().clone();
57
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)
+ let to_insert = [generic_args.syntax().clone().into()];
+ self.insert_children(InsertPosition::After(anchor.into()), array::IntoIter::new(to_insert))
61
}
62
63
0 commit comments