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
Document #[from] attribute, it is otherwise not clear that you can use it.
Previous (wrong) issue:
thiserror supports the #[from] attribute (see details) to reduce manually written that code, justerror should support it too:
use thiserror::Error;#[derive(Error,Debug)]pubenumDataStoreError{#[error("data store disconnected")]Disconnect(#[from] io::Error),/// **HERE**#[error("the data for key `{0}` is not available")]Redaction(String),#[error("invalid header (expected {expected:?}, found {found:?})")]InvalidHeader{expected:String,found:String,},#[error("unknown data store error")]Unknown,}
You otherwise need to manually impl the From trait:
Document
#[from]
attribute, it is otherwise not clear that you can use it.Previous (wrong) issue:
The text was updated successfully, but these errors were encountered: