From 5d0535276cd4f1fac8539cd7682c8720c61c41df Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 17 Jan 2023 16:35:46 +0100 Subject: [PATCH] style: use #[error(transparent)] instead of #[error("{0}")] This is the canonical way of forwarding an error message with the "thiserror" crate. --- src/merge_tools.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/merge_tools.rs b/src/merge_tools.rs index e7e5f5c4d..29253b9ab 100644 --- a/src/merge_tools.rs +++ b/src/merge_tools.rs @@ -67,7 +67,7 @@ pub enum ExternalToolError { #[derive(Debug, Error)] pub enum DiffEditError { - #[error("{0}")] + #[error(transparent)] ExternalToolError(#[from] ExternalToolError), #[error("Failed to write directories to diff: {0:?}")] CheckoutError(#[from] CheckoutError), @@ -77,7 +77,7 @@ pub enum DiffEditError { #[derive(Debug, Error)] pub enum ConflictResolveError { - #[error("{0}")] + #[error(transparent)] ExternalToolError(#[from] ExternalToolError), #[error( "To use `{tool_name}` as a merge tool, the config `merge-tools.{tool_name}.merge-args` \