Skip to content

Commit

Permalink
Merge pull request #342 from yongqli/master
Browse files Browse the repository at this point in the history
Change some functions to accept IntoIterator instead of Iterator
  • Loading branch information
mulimoen authored Dec 19, 2023
2 parents dcbc203 + 918c38c commit 2c440a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sprs/src/sparse/csmat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,9 @@ impl<N, I: SpIndex, Iptr: SpIndex> CsMatI<N, I, Iptr> {
pub fn append_outer_iter<Iter>(self, iter: Iter) -> Self
where
N: Zero,
Iter: Iterator<Item = (usize, N)>,
Iter: IntoIterator<Item = (usize, N)>,
{
let iter = iter.into_iter();
unsafe {
self.append_outer_iter_unchecked(AssertOrderedIterator {
prev: None,
Expand All @@ -596,8 +597,9 @@ impl<N, I: SpIndex, Iptr: SpIndex> CsMatI<N, I, Iptr> {
iter: Iter,
) -> Self
where
Iter: Iterator<Item = (usize, N)>,
Iter: IntoIterator<Item = (usize, N)>,
{
let iter = iter.into_iter();
if let (_, Some(nnz)) = iter.size_hint() {
self.reserve_nnz(nnz)
}
Expand Down

0 comments on commit 2c440a5

Please sign in to comment.