From 8b644846a4516ed222872b59dcb745740cc4a9e5 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Sat, 21 Jan 2023 00:22:24 +0100 Subject: [PATCH] refactor: use #[from] on error alternative --- lib/src/op_heads_store.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/src/op_heads_store.rs b/lib/src/op_heads_store.rs index e6d02d750..7a88a8498 100644 --- a/lib/src/op_heads_store.rs +++ b/lib/src/op_heads_store.rs @@ -28,13 +28,7 @@ pub enum OpHeadResolutionError { #[error("Operation log has no heads")] NoHeads, #[error("Op resolution error: {0}")] - Err(E), -} - -impl From for OpHeadResolutionError { - fn from(e: E) -> Self { - OpHeadResolutionError::Err(e) - } + Err(#[from] E), } pub trait OpHeadsStoreLock<'a> {