aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/ast
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2021-03-25 19:06:48 +0000
committerLaurenČ›iu Nicola <[email protected]>2021-03-25 19:06:48 +0000
commitbc5c86543b1bf384555471415dee770888a1781d (patch)
treeb4c30f7eacbe0dd03bebafc534c7a8bdbfee7aa6 /crates/syntax/src/ast
parent9787bddac577a6aa24388fb91286474a7a8cf0bc (diff)
Use more std::array::IntoIter
Diffstat (limited to 'crates/syntax/src/ast')
-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