Implement ExcerptList::subscribe

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-12-06 13:37:17 -07:00
parent a02a29944c
commit 4578938ea1
5 changed files with 119 additions and 54 deletions

View file

@ -210,6 +210,15 @@ impl<'a, T: Clone> IntoIterator for &'a Patch<T> {
}
}
impl<'a, T: Clone> IntoIterator for &'a mut Patch<T> {
type Item = Edit<T>;
type IntoIter = std::iter::Cloned<std::slice::Iter<'a, Edit<T>>>;
fn into_iter(self) -> Self::IntoIter {
self.0.iter().cloned()
}
}
#[cfg(test)]
mod tests {
use super::*;