You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BufResult being aliased to a tuple makes it less ergonomic than a standard Result could be.
In future, a std::ops::Try implementation could help, but it needs a local type to be implemented on.
I propose to make use of the standard infrastructure provided by Result and provide the buffer with a new error type:
use std::error::Error;use std::io;pubtypeBufResult<T,B> = Result<(T,B),BufError<B>>;#[derive(Debug)]pubstructBufError<B>(pub io::Error,pubB);impl<B:Debug>ErrorforBufError<B>{// ...}