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);