refactor: Return copied TextRange in CommentRanges iterator (#13281)

This commit is contained in:
Micha Reiser 2024-09-08 13:17:37 +02:00 committed by GitHub
parent e4aa479515
commit 35d45c1e4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 20 additions and 20 deletions

View file

@ -215,10 +215,10 @@ impl Debug for CommentRanges {
}
impl<'a> IntoIterator for &'a CommentRanges {
type Item = &'a TextRange;
type IntoIter = std::slice::Iter<'a, TextRange>;
type Item = TextRange;
type IntoIter = std::iter::Copied<std::slice::Iter<'a, TextRange>>;
fn into_iter(self) -> Self::IntoIter {
self.raw.iter()
self.raw.iter().copied()
}
}