aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/syntax/src/ast/edit.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs
index 2d1d08fba..8c60927e4 100644
--- a/crates/syntax/src/ast/edit.rs
+++ b/crates/syntax/src/ast/edit.rs
@@ -2,7 +2,7 @@
2//! immutable, all function here return a fresh copy of the tree, instead of 2//! immutable, all function here return a fresh copy of the tree, instead of
3//! doing an in-place modification. 3//! doing an in-place modification.
4use std::{ 4use std::{
5 fmt, iter, 5 array, fmt, iter,
6 ops::{self, RangeInclusive}, 6 ops::{self, RangeInclusive},
7}; 7};
8 8
@@ -55,9 +55,8 @@ impl ast::Fn {
55 55
56 let anchor = self.name().expect("The function must have a name").syntax().clone(); 56 let anchor = self.name().expect("The function must have a name").syntax().clone();
57 57
58 let mut to_insert: ArrayVec<SyntaxElement, 1> = ArrayVec::new(); 58 let to_insert = [generic_args.syntax().clone().into()];
59 to_insert.push(generic_args.syntax().clone().into()); 59 self.insert_children(InsertPosition::After(anchor.into()), array::IntoIter::new(to_insert))
60 self.insert_children(InsertPosition::After(anchor.into()), to_insert)
61 } 60 }
62} 61}
63 62