From 017a63b4e58b5878bdfeb3d102f1e6885ad10933 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 27 Nov 2024 16:11:30 +0200 Subject: [PATCH] update enum names --- src/client/connection.rs | 4 ++-- src/client/connection/error.rs | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/connection.rs b/src/client/connection.rs index d11f006..41c00f8 100644 --- a/src/client/connection.rs +++ b/src/client/connection.rs @@ -58,7 +58,7 @@ pub fn auth( certificate: TlsCertificate, ) -> Result { if socket_connection.is_closed() { - return Err(Error::Closed); + return Err(Error::SocketConnectionClosed); } // https://geminiprotocol.net/docs/protocol-specification.gmi#the-use-of-tls @@ -77,6 +77,6 @@ pub fn auth( Ok(tls_client_connection) } - Err(reason) => Err(Error::Tls(reason)), + Err(reason) => Err(Error::TlsClientConnection(reason)), } } diff --git a/src/client/connection/error.rs b/src/client/connection/error.rs index aec2687..48eed23 100644 --- a/src/client/connection/error.rs +++ b/src/client/connection/error.rs @@ -2,15 +2,17 @@ use std::fmt::{Display, Formatter, Result}; #[derive(Debug)] pub enum Error { - Closed, - Tls(glib::Error), + SocketConnectionClosed, + TlsClientConnection(glib::Error), } impl Display for Error { fn fmt(&self, f: &mut Formatter) -> Result { match self { - Self::Closed => write!(f, "Socket connection closed"), - Self::Tls(reason) => write!(f, "Could not create TLS connection: {reason}"), + Self::SocketConnectionClosed => write!(f, "Socket connection closed"), + Self::TlsClientConnection(reason) => { + write!(f, "Could not create TLS connection: {reason}") + } } } }