But compilation fails saying the Write trait is not satisfied.
|
272 | c.write_all(buf).expect();
| ^^^^^^^^^ method cannot be called on `&mut std::io::Cursor<T>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`std::io::Cursor<T>: std::io::Write`
which is required by `&mut std::io::Cursor<T>: std::io::Write`
Any idea how I can fix the type alias to add the trait bound? (I thought the where std::io::Cursor<T>: std::io::Write would do the trick, but apparently it doesn't.
Thanks!
Edit: I know I can fix it by adding where std::io::Cursor<T>: std::io::Write at the end of the function declaration, but I am trying to avoid to have to keep writing this for every function.