From abebb330af5d0dfd7cc1e2675c8adac384f83d4a Mon Sep 17 00:00:00 2001 From: Maarten de Vries Date: Wed, 3 Mar 2021 21:04:42 +0100 Subject: [PATCH] Implement From and From for Error. --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 5efc162..406e64f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -48,7 +48,7 @@ pub enum Error { /// - When writing: your message is bigger than the configured max message size /// (64MB by default). #[error("Space limit exceeded: {0}")] - Capacity(CapacityError), + Capacity(#[from] CapacityError), /// Protocol violation. #[error("WebSocket protocol error: {0}")] Protocol(#[from] ProtocolError), @@ -60,7 +60,7 @@ pub enum Error { Utf8, /// Invalid URL. #[error("URL error: {0}")] - Url(UrlError), + Url(#[from] UrlError), /// HTTP error. #[error("HTTP error: {}", .0.status())] Http(Response>),