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:
Dhruv Manilawala 2024-05-13 21:54:49 +05:30 committed by GitHub
parent ca99e9e2f0
commit c3c87e86ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 8 deletions

View file

@ -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>;