From 8968ee8e536d653a4283e900bfaddc1b456eca75 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 14 Sep 2025 23:25:33 +0800 Subject: refactor: better error handling --- src/client/connector.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/client/connector.rs') diff --git a/src/client/connector.rs b/src/client/connector.rs index 7b5e1cd..1455eac 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -16,7 +16,7 @@ pub trait Connection { // TODO: queue failed ntfy // TODO: impl type of data - fn ntfy(&self, data: String) -> Result; + fn ntfy(&self, data: String) -> std::result::Result<(), Self::Err>; fn is_prev(&mut self, str: &Self::Ok) -> bool; @@ -26,7 +26,7 @@ pub trait Connection { _ = Executor::new("network", ["on".to_string()]); } - fn init(&self, c: &Client) + fn init(&self, c: &Client) -> std::result::Result<(), Self::Err> where Self: std::marker::Sized, { @@ -35,7 +35,6 @@ pub trait Connection { {c} "#, )) - .unwrap(); } fn reinit(&mut self) { -- cgit v1.2.3