aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/objects/highlightrulemanager.rs
diff options
context:
space:
mode:
authorMax Audron <me@audron.dev>2026-02-21 17:48:06 +0100
committerMax Audron <me@audron.dev>2026-02-21 17:48:06 +0100
commitcc542048e369dda0a773e1e3a4601dc7d20ff16a (patch)
treeee3a23a88c0cb39cf222b871932636a2c912dd92 /src/message/signalproxy/objects/highlightrulemanager.rs
parenthandshare and signalproxy/rpccall error handling (diff)
Syncable trait error handling
Diffstat (limited to 'src/message/signalproxy/objects/highlightrulemanager.rs')
-rw-r--r--src/message/signalproxy/objects/highlightrulemanager.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/message/signalproxy/objects/highlightrulemanager.rs b/src/message/signalproxy/objects/highlightrulemanager.rs
index 7accb17..9af0b4c 100644
--- a/src/message/signalproxy/objects/highlightrulemanager.rs
+++ b/src/message/signalproxy/objects/highlightrulemanager.rs
@@ -1,5 +1,6 @@
use libquassel_derive::{sync, NetworkList, NetworkMap};
+use crate::error::ProtocolError;
use crate::message::Class;
#[allow(unused_imports)]
@@ -135,7 +136,7 @@ impl HighlightRuleManager {
#[cfg(feature = "client")]
impl StatefulSyncableClient for HighlightRuleManager {
- fn sync_custom(&mut self, mut msg: crate::message::SyncMessage)
+ fn sync_custom(&mut self, mut msg: crate::message::SyncMessage) -> Result<(), ProtocolError>
where
Self: Sized,
{
@@ -156,12 +157,13 @@ impl StatefulSyncableClient for HighlightRuleManager {
"setNicksCaseSensitive" => self.set_nicks_case_sensitive(get_param!(msg)),
_ => (),
}
+ Ok(())
}
}
#[cfg(feature = "server")]
impl StatefulSyncableServer for HighlightRuleManager {
- fn sync_custom(&mut self, mut msg: crate::message::SyncMessage)
+ fn sync_custom(&mut self, mut msg: crate::message::SyncMessage) -> Result<(), ProtocolError>
where
Self: Sized,
{
@@ -182,6 +184,7 @@ impl StatefulSyncableServer for HighlightRuleManager {
"requestSetNicksCaseSensitive" => self.set_nicks_case_sensitive(get_param!(msg)),
_ => (),
}
+ Ok(())
}
}
@@ -223,11 +226,12 @@ impl From<HighlightNickType> for Variant {
}
}
-// TODO error handling
-impl From<Variant> for HighlightNickType {
- fn from(value: Variant) -> Self {
- #[allow(clippy::unnecessary_fallible_conversions)]
- HighlightNickType::try_from(value).unwrap()
+impl TryFrom<Variant> for HighlightNickType {
+ type Error = ProtocolError;
+
+ fn try_from(value: Variant) -> Result<Self, Self::Error> {
+ let i: i32 = value.try_into()?;
+ Self::try_from(i).map_err(|_| ProtocolError::WrongVariant)
}
}