From 2d4cdc760b42046d09001334fbfa367eafb72bc7 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 19 Apr 2024 15:28:59 +0200 Subject: [PATCH] tweak return type for integrate_for(); we can re-add Result<> as needed --- src/webxdc/integration.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webxdc/integration.rs b/src/webxdc/integration.rs index b1d0ae8177..d361fb37ac 100644 --- a/src/webxdc/integration.rs +++ b/src/webxdc/integration.rs @@ -75,7 +75,7 @@ impl Context { instance: Message, status_update: StatusUpdateItem, ) -> Result<()> { - let chat_id = instance.webxdc_integrated_for()?; + let chat_id = instance.webxdc_integrated_for(); maps_integration::intercept_send_update(self, chat_id, status_update).await } @@ -85,7 +85,7 @@ impl Context { instance: Message, last_known_serial: StatusUpdateSerial, ) -> Result { - let chat_id = instance.webxdc_integrated_for()?; + let chat_id = instance.webxdc_integrated_for(); maps_integration::intercept_get_updates(self, chat_id, last_known_serial).await } } @@ -93,14 +93,14 @@ impl Context { impl Message { // Get chat the Webxdc is integrated for. // This is the chat given to `init_webxdc_integration()`. - fn webxdc_integrated_for(&self) -> Result> { + fn webxdc_integrated_for(&self) -> Option { let raw_id = self.param.get_int(Param::WebxdcIntegrateFor).unwrap_or(0) as u32; let chat_id = if raw_id > 0 { Some(ChatId::new(raw_id)) } else { None }; - Ok(chat_id) + chat_id } }