Implement `Clone` for `CsrTripletIter` and `CscTripletIter`

This commit is contained in:
Moritz Hedtke 2023-08-21 21:40:12 +00:00
parent 0b89950fca
commit 86bde5ff1d
2 changed files with 18 additions and 0 deletions

View File

@ -625,6 +625,15 @@ pub struct CscTripletIter<'a, T> {
values_iter: Iter<'a, T>, values_iter: Iter<'a, T>,
} }
impl<'a, T> Clone for CscTripletIter<'a, T> {
fn clone(&self) -> Self {
CscTripletIter {
pattern_iter: self.pattern_iter.clone(),
values_iter: self.values_iter.clone(),
}
}
}
impl<'a, T: Clone> CscTripletIter<'a, T> { impl<'a, T: Clone> CscTripletIter<'a, T> {
/// Adapts the triplet iterator to return owned values. /// Adapts the triplet iterator to return owned values.
/// ///

View File

@ -626,6 +626,15 @@ pub struct CsrTripletIter<'a, T> {
values_iter: Iter<'a, T>, values_iter: Iter<'a, T>,
} }
impl<'a, T> Clone for CsrTripletIter<'a, T> {
fn clone(&self) -> Self {
CsrTripletIter {
pattern_iter: self.pattern_iter.clone(),
values_iter: self.values_iter.clone(),
}
}
}
impl<'a, T: Clone> CsrTripletIter<'a, T> { impl<'a, T: Clone> CsrTripletIter<'a, T> {
/// Adapts the triplet iterator to return owned values. /// Adapts the triplet iterator to return owned values.
/// ///