Guess the language by the error
Jan. 13th, 2020 02:47 pmOk, can we pass a function that consumes items instead of returning an Iterator?
Computer says "no".
error[E0666]: nested `impl Trait` is not allowed
--> src/main.rs:103:63
|
103 | fn scan<T>(&mut self, z: T, mut f: impl FnMut(HeapElement, impl std::io::Read, T) -> T) -> std::io::Result<T> {
| ------------------------^^^^^^^^^^^^^^^^^^---------
| | |
| | nested `impl Trait` here
| outer `impl Trait`
no subject
Date: 2020-01-13 03:02 pm (UTC)no subject
Date: 2020-01-13 11:05 pm (UTC)The other funny thing is why f needs to be mut, when it is of type FnMut.
no subject
Date: 2020-01-13 11:30 pm (UTC)