diff --git a/src/filters/ratelimit.rs b/src/filters/ratelimit.rs index 44cb514..c4281b9 100644 --- a/src/filters/ratelimit.rs +++ b/src/filters/ratelimit.rs @@ -63,14 +63,15 @@ impl NoteFilter for RateLimit { } if entry.tokens == 0 { + let message = self + .message + .as_deref() + .unwrap_or("rate-limited: you are noting too much"); + return OutputMessage::new( msg.event.id.clone(), Action::Reject, - Some( - self.message - .clone() - .unwrap_or("rate-limited: you are noting too much".to_string()), - ), + Some(message.to_owned()), ); }