From 799b5bb2b4f56fb552698ecd136b19f1945dcefa Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Tue, 23 Feb 2021 18:59:54 -0800 Subject: [PATCH] Fix mangled error Display impls These were formatting the literal integer 0 instead of the inner data. --- quinn-proto/src/connection/mod.rs | 4 ++-- quinn-proto/src/connection/streams/recv.rs | 2 +- quinn-proto/src/connection/streams/send.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 0acc8cbd9..02b71eca7 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -3365,10 +3365,10 @@ pub enum ConnectionError { #[error("{0}")] TransportError(#[from] TransportError), /// The peer's QUIC stack aborted the connection automatically - #[error("aborted by peer: {}", 0)] + #[error("aborted by peer: {0}")] ConnectionClosed(frame::ConnectionClose), /// The peer closed the connection - #[error("closed by peer: {}", 0)] + #[error("closed by peer: {0}")] ApplicationClosed(frame::ApplicationClose), /// The peer is unable to continue processing this connection, usually due to having restarted #[error("reset by peer")] diff --git a/quinn-proto/src/connection/streams/recv.rs b/quinn-proto/src/connection/streams/recv.rs index bcbeeec76..f95344feb 100644 --- a/quinn-proto/src/connection/streams/recv.rs +++ b/quinn-proto/src/connection/streams/recv.rs @@ -304,7 +304,7 @@ pub enum ReadError { /// The peer abandoned transmitting data on this stream. /// /// Carries an application-defined error code. - #[error("reset by peer: code {}", 0)] + #[error("reset by peer: code {0}")] Reset(VarInt), /// The stream has not been opened or was already stopped, finished, or reset #[error("unknown stream")] diff --git a/quinn-proto/src/connection/streams/send.rs b/quinn-proto/src/connection/streams/send.rs index 796c104a0..a33a69c70 100644 --- a/quinn-proto/src/connection/streams/send.rs +++ b/quinn-proto/src/connection/streams/send.rs @@ -142,7 +142,7 @@ pub enum WriteError { /// Carries an application-defined error code. /// /// [`StreamEvent::Finished`]: crate::StreamEvent::Finished - #[error("stopped by peer: code {}", 0)] + #[error("stopped by peer: code {0}")] Stopped(VarInt), /// The stream has not been opened or has already been finished or reset #[error("unknown stream")] @@ -170,7 +170,7 @@ pub enum FinishError { /// Carries an application-defined error code. /// /// [`StreamEvent::Finished`]: crate::StreamEvent::Finished - #[error("stopped by peer: code {}", 0)] + #[error("stopped by peer: code {0}")] Stopped(VarInt), /// The stream has not been opened or was already finished or reset #[error("unknown stream")]