From 03fdcc300be90b19444e475492b047ffbdf59e5c Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 25 Feb 2024 01:31:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20IcalinguaStatus=20?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BD=93=E7=9A=84=E6=96=B9=E6=B3=95=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/src/client.rs | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/ica-rs/src/client.rs b/ica-rs/src/client.rs index f96434e..ff77a4e 100644 --- a/ica-rs/src/client.rs +++ b/ica-rs/src/client.rs @@ -47,25 +47,14 @@ impl IcalinguaStatus { self.online_data = Some(online_data); } - pub fn update_rooms(&mut self, rooms: Vec) { - self.rooms = Some(rooms); - } + pub fn update_rooms(&mut self, rooms: Vec) { self.rooms = Some(rooms); } - pub fn update_login_status(&mut self, login: bool) { - self.login = login; - } + pub fn update_login_status(&mut self, login: bool) { self.login = login; } - pub fn update_config(&mut self, config: IcaConfig) { - self.config = Some(config); - } + pub fn update_config(&mut self, config: IcaConfig) { self.config = Some(config); } pub fn get_online_data() -> &'static OnlineData { - unsafe { - ClientStatus - .online_data - .as_ref() - .expect("online_data should be set") - } + unsafe { ClientStatus.online_data.as_ref().expect("online_data should be set") } } pub fn get_config() -> &'static IcaConfig { @@ -99,8 +88,5 @@ pub async fn sign_callback(payload: Payload, client: Client) { let signature: Signature = signing_key.sign(salt.as_slice()); let sign = signature.to_bytes().to_vec(); - client - .emit("auth", sign) - .await - .expect("Faild to send signin data"); + client.emit("auth", sign).await.expect("Faild to send signin data"); }