Update assignment 6

This commit is contained in:
Minseong Jang
2022-10-10 22:28:50 +09:00
parent 6806ae0da5
commit c193cacb38
2 changed files with 1 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
//! Assignment 6: Mastering advanced types.
//! Assignment 6: Mastering advanced types (1/2).
//!
//! The primary goal of this assignment is to understand generics, traits, and lifetimes.
//!
@@ -140,26 +140,3 @@ impl<C: Semiring> Polynomial<C> {
todo!()
}
}
struct FindIter<'s, T: Eq> {
query: &'s [T],
base: &'s [T],
curr: usize,
}
impl<T: Eq> Iterator for FindIter<'_, T> {
type Item = usize;
fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}
/// Returns an iterator over substring query indexes in the base.
pub fn find<'s, T: Eq>(query: &'s [T], base: &'s [T]) -> impl 's + Iterator<Item = usize> {
FindIter {
query,
base,
curr: 0,
}
}