From fd23c4672663d7d1e18ff38bde13c2567ef9fe9c Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 18 Dec 2020 16:34:33 +1000 Subject: [PATCH] Remove a redundant fmt::Display bound --- zebra-network/src/peer/connection.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zebra-network/src/peer/connection.rs b/zebra-network/src/peer/connection.rs index 3d9887046..37dbe3a43 100644 --- a/zebra-network/src/peer/connection.rs +++ b/zebra-network/src/peer/connection.rs @@ -7,7 +7,7 @@ //! And it's unclear if these assumptions match the `zcashd` implementation. //! It should be refactored into a cleaner set of request/response pairs (#1515). -use std::{collections::HashSet, fmt, sync::Arc}; +use std::{collections::HashSet, sync::Arc}; use futures::{ channel::{mpsc, oneshot}, @@ -495,8 +495,9 @@ where /// Marks the peer as having failed with error `e`. fn fail_with(&mut self, e: E) where - E: Into + fmt::Display, + E: Into, { + let e = e.into(); debug!(%e, "failing peer service with error"); // Update the shared error slot let mut guard = self @@ -507,7 +508,7 @@ where if guard.is_some() { panic!("called fail_with on already-failed connection state"); } else { - *guard = Some(e.into()); + *guard = Some(e); } // Drop the guard immediately to release the mutex. std::mem::drop(guard);