refactor 200 iterator

This commit is contained in:
Dr. Matthias Ratajczak
2022-09-28 15:26:23 +02:00
parent 4f9d64a987
commit b305da92d0
2 changed files with 20 additions and 14 deletions
+6 -1
View File
@@ -6,12 +6,13 @@ use std::fs::File;
use std::hash::Hash;
use std::io::Write;
use std::slice::Iter;
use std::vec::IntoIter;
use num::FromPrimitive;
use num::Num;
use num::ToPrimitive;
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct Primes<T> {
vector: Vec<T>,
set: HashSet<T>,
@@ -110,6 +111,10 @@ where
pub fn into_vec(self) -> Vec<T> {
self.vector
}
pub fn to_cloned_iter(&self) -> IntoIter<T> {
self.vector.clone().into_iter()
}
}
#[cfg(test)]