mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Use more std::array::IntoIter
This commit is contained in:
parent
9787bddac5
commit
bc5c86543b
1 changed files with 3 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
||||||
//! immutable, all function here return a fresh copy of the tree, instead of
|
//! immutable, all function here return a fresh copy of the tree, instead of
|
||||||
//! doing an in-place modification.
|
//! doing an in-place modification.
|
||||||
use std::{
|
use std::{
|
||||||
fmt, iter,
|
array, fmt, iter,
|
||||||
ops::{self, RangeInclusive},
|
ops::{self, RangeInclusive},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,9 +55,8 @@ impl ast::Fn {
|
||||||
|
|
||||||
let anchor = self.name().expect("The function must have a name").syntax().clone();
|
let anchor = self.name().expect("The function must have a name").syntax().clone();
|
||||||
|
|
||||||
let mut to_insert: ArrayVec<SyntaxElement, 1> = ArrayVec::new();
|
let to_insert = [generic_args.syntax().clone().into()];
|
||||||
to_insert.push(generic_args.syntax().clone().into());
|
self.insert_children(InsertPosition::After(anchor.into()), array::IntoIter::new(to_insert))
|
||||||
self.insert_children(InsertPosition::After(anchor.into()), to_insert)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue