From 1dfaf682673dbf6d576a740f4371a72658e699cb Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 30 Nov 2024 04:35:02 +0200 Subject: [PATCH] rename enum option --- src/client/connection.rs | 4 ++-- src/client/connection/error.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/connection.rs b/src/client/connection.rs index 94d5a00..b9f799e 100644 --- a/src/client/connection.rs +++ b/src/client/connection.rs @@ -23,7 +23,7 @@ impl Connection { server_identity: Option, ) -> Result { if socket_connection.is_closed() { - return Err(Error::SocketConnectionClosed); + return Err(Error::Closed); } Ok(Self { @@ -118,7 +118,7 @@ pub fn new_tls_client_connection( server_identity: Option<&NetworkAddress>, ) -> Result { if socket_connection.is_closed() { - return Err(Error::SocketConnectionClosed); + return Err(Error::Closed); } // https://geminiprotocol.net/docs/protocol-specification.gmi#the-use-of-tls diff --git a/src/client/connection/error.rs b/src/client/connection/error.rs index 5e3f47e..87131f7 100644 --- a/src/client/connection/error.rs +++ b/src/client/connection/error.rs @@ -2,19 +2,19 @@ use std::fmt::{Display, Formatter, Result}; #[derive(Debug)] pub enum Error { + Closed, Rehandshake(glib::Error), SocketConnection(glib::Error), - SocketConnectionClosed, TlsClientConnection(glib::Error), } impl Display for Error { fn fmt(&self, f: &mut Formatter) -> Result { match self { + Self::Closed => write!(f, "Connection closed"), Self::Rehandshake(e) => { write!(f, "Rehandshake error: {e}") } - Self::SocketConnectionClosed => write!(f, "Socket connection closed"), Self::SocketConnection(e) => { write!(f, "Socket connection error: {e}") }