diff --git a/src/admin/context.rs b/src/admin/context.rs index 16ee02029..458f57ef1 100644 --- a/src/admin/context.rs +++ b/src/admin/context.rs @@ -56,7 +56,6 @@ pub(crate) fn sender_or_service_user(&self) -> &UserId { /// self.bail_restricted()?; /// // actual command impl /// ``` - #[must_use] pub(crate) fn bail_restricted(&self) -> Result { if self.source.allows_restricted() { Ok(()) diff --git a/src/service/admin/mod.rs b/src/service/admin/mod.rs index ac7447b57..df0034f00 100644 --- a/src/service/admin/mod.rs +++ b/src/service/admin/mod.rs @@ -81,6 +81,7 @@ impl InvocationSource { /// Returns whether this invocation source allows "restricted" /// commands, i.e. ones that could be potentially dangerous if executed by /// an attacker or in a public room. + #[must_use] pub fn allows_restricted(&self) -> bool { !matches!(self, Self::EscapedCommand) } } @@ -546,7 +547,7 @@ pub async fn is_admin_command(&self, event: &E, body: &str) -> Option(&self, event: &E, body: &str) -> Option