mirror of
https://git.intege.rs/xlib/x.git
synced 2025-12-05 20:35:01 +00:00
.
This commit is contained in:
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user