From 4aa55019904eef67fc693e346dce4080d299d453 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sun, 20 Aug 2023 02:32:16 -0400 Subject: [PATCH] Simplify Display impl For some reason, `fmt::Display for Error` uses an unusual form `match &self.inner { &Value(ref err) => err.fmt(f), ...}`. It seems `Value(err)` will work just as well. If this is actually needed, we should add some comment explaining why so --- src/kv/error.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kv/error.rs b/src/kv/error.rs index c72d32396..9643a47f2 100644 --- a/src/kv/error.rs +++ b/src/kv/error.rs @@ -47,10 +47,10 @@ impl fmt::Display for Error { use self::Inner::*; match &self.inner { #[cfg(feature = "std")] - &Boxed(ref err) => err.fmt(f), - &Value(ref err) => err.fmt(f), - &Msg(ref msg) => msg.fmt(f), - &Fmt => fmt::Error.fmt(f), + Boxed(err) => err.fmt(f), + Value(err) => err.fmt(f), + Msg(msg) => msg.fmt(f), + Fmt => fmt::Error.fmt(f), } } }