This commit is contained in:
Numbers
2024-05-16 00:09:45 -04:00
parent a1379c2696
commit 973c4311bb
3 changed files with 8 additions and 1 deletions

View File

@@ -84,3 +84,7 @@ mod pointer_iterator {
pub fn iterate<T: pointer_iterator::Pointer>(pointer: T) -> T::IterType {
pointer.into_iter()
}
pub fn fill_with<T, F: FnMut(usize) -> T>(slice: &mut [T], mut func: F) {
slice.iter_mut().enumerate().for_each(|(i,v)|*v = func(i))
}