refactor: use #[from] on error alternative

This commit is contained in:
Samuel Tardieu 2023-01-21 00:22:24 +01:00
parent 8a1b21ff73
commit 8b644846a4

View file

@ -28,13 +28,7 @@ pub enum OpHeadResolutionError<E> {
#[error("Operation log has no heads")] #[error("Operation log has no heads")]
NoHeads, NoHeads,
#[error("Op resolution error: {0}")] #[error("Op resolution error: {0}")]
Err(E), Err(#[from] E),
}
impl<E> From<E> for OpHeadResolutionError<E> {
fn from(e: E) -> Self {
OpHeadResolutionError::Err(e)
}
} }
pub trait OpHeadsStoreLock<'a> { pub trait OpHeadsStoreLock<'a> {