mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-20 10:30:56 +00:00
Implement IntoIterator
for FStringElements
(#11410)
A change which I lost somewhere when I force pushed in https://github.com/astral-sh/ruff/pull/11400
This commit is contained in:
parent
ca99e9e2f0
commit
c3c87e86ef
5 changed files with 26 additions and 8 deletions
|
@ -1526,6 +1526,24 @@ impl From<Vec<FStringElement>> for FStringElements {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a FStringElements {
|
||||
type IntoIter = Iter<'a, FStringElement>;
|
||||
type Item = &'a FStringElement;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a mut FStringElements {
|
||||
type IntoIter = IterMut<'a, FStringElement>;
|
||||
type Item = &'a mut FStringElement;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.iter_mut()
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for FStringElements {
|
||||
type Target = Vec<FStringElement>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue