> While solving a not-so-easy lifetime problem in Rust related to async closures,
The problem is async not the borrow checker. Async adds a lot of incidental complexity
The problem is async not the borrow checker. Async adds a lot of incidental complexity
pub fn with_vec_align<A,V>(file_name: &str,
f: &dyn Fn(&[V]) -> A) -> A
pub fn with_vec_align_mut<A,V>(file_name: &str,
f: &mut dyn FnMut(&[V]) -> A) -> A
pub fn with_vec<A>(file_name: &str,
f: &dyn Fn(&[u8]) -> A) -> A
fn with_vec_mut<A>(file_name: &str,
f: &mut dyn FnMut(&[u8]) -> A) -> A
pub fn with_mut_vec<A, V>(file_name: &str,
f: &dyn Fn(&mut [V]) -> A) -> A
It's the kind of thing I'd hope polymorphism would solve (maybe it already does but I just don't know how to leverage it).