daydream

A small matrix web client written in rust
git clone git://archive.git.mtrnord.blog/daydream-mx/daydream.git
Log | Files | Refs | README | LICENSE

commit 5fb621b033eca5022ad2dc72069fd365763b7eab
parent 17d27c8b224341ba52ed583e367fafc8a1b81c90
Author: Marcel <mtrnord1@gmail.com>
Date:   Thu,  9 Jul 2020 14:16:56 +0200

Fix small clippy warnings

Took 4 minutes

Diffstat:
Msrc/app/matrix/mod.rs | 5++++-
Msrc/utils/notifications.rs | 9+++++++--
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/app/matrix/mod.rs b/src/app/matrix/mod.rs @@ -401,7 +401,10 @@ impl Agent for MatrixAgent { }), }) }; - client.room_send(&room_id, content, None).await; + if let Err(e) = client.room_send(&room_id, content, None).await { + // TODO show error in UI or try again if possible + error!("Error sending message: {}", e); + } }); } } diff --git a/src/utils/notifications.rs b/src/utils/notifications.rs @@ -34,7 +34,9 @@ impl Notifications { } }) as Box<dyn FnMut()>); - Notification::request_permission_with_permission_callback(cb.as_ref().unchecked_ref()); + if let Err(_e) = Notification::request_permission_with_permission_callback(cb.as_ref().unchecked_ref()) { + // Noop to please clippy/rust compiler + } cb.forget(); } else { self.show_actual(); @@ -49,6 +51,9 @@ impl Notifications { } else { options }; - Notification::new_with_options(&self.displayname, &options); + if let Err(_e) = Notification::new_with_options(&self.displayname, &options) { + // Noop to please clippy/rust compiler + // TODO check if we in this case should stop showing notifications + } } }