commit f08e805673ccaf1aee0f9b00cc4a92dbf8bdead1
parent 39d70fd179dfb2e539e19801d10f468187691b47
Author: William Casarin <jb55@jb55.com>
Date: Tue, 9 Jul 2024 11:05:01 -0700
filters/protected_events: fix clippy
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/filters/protected_events.rs b/src/filters/protected_events.rs
@@ -6,8 +6,8 @@ pub struct ProtectedEvents {}
impl NoteFilter for ProtectedEvents {
fn filter_note(&mut self, input: &InputMessage) -> OutputMessage {
- for tag in &input.event.tags {
- for entry in tag {
+ if let Some(tag) = input.event.tags.first() {
+ if let Some(entry) = tag.first() {
if entry == "-" {
return OutputMessage::new(
input.event.id.clone(),
@@ -15,9 +15,7 @@ impl NoteFilter for ProtectedEvents {
Some("blocked: event marked as protected".to_string()),
);
}
- break;
}
- break;
}
OutputMessage::new(input.event.id.clone(), Action::Accept, None)