From bc5c86543b1bf384555471415dee770888a1781d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Thu, 25 Mar 2021 21:06:48 +0200 Subject: Use more std::array::IntoIter --- crates/syntax/src/ast/edit.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates') 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 @@ //! immutable, all function here return a fresh copy of the tree, instead of //! doing an in-place modification. use std::{ - fmt, iter, + array, fmt, iter, ops::{self, RangeInclusive}, }; @@ -55,9 +55,8 @@ impl ast::Fn { let anchor = self.name().expect("The function must have a name").syntax().clone(); - let mut to_insert: ArrayVec = ArrayVec::new(); - to_insert.push(generic_args.syntax().clone().into()); - 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)) } } -- cgit v1.2.3