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
Error trait is crucial in usage like converting error to something like Anyhow::Error,which can be used to propagate errors simply. Some functions use Error<()>, but unit type is not Display, so it will not have Error trait.
A workaround looks like this, which requires manual conversion of error.
let serial = bs.open_protocol_exclusive::<Serial>(serial_handle).map_err(|x| anyhow!("Failed to open serial protocol, status {}",x.status()))?;
Due to implementation of a trait cannot overlap, simply do impl<Data: Debug> Display for Error<Data> will not work.