Skip to content

Commit 480bb22

Browse files
author
Bartok9
committed
fix(relay): rustfmt + clippy for offline-mention tests
Address CI fmt-check and cloned_ref_to_slice_refs on #2296. Signed-off-by: Bartok9 <danielrpike9@gmail.com>
1 parent 27f919c commit 480bb22

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

crates/buzz-relay/src/handlers/event.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,10 +2764,7 @@ mod tests {
27642764
nostr::Tag::parse(["p", &author]).unwrap(),
27652765
nostr::Tag::parse(["h", "00000000-0000-0000-0000-000000000001"]).unwrap(),
27662766
nostr::Tag::parse(["p", &offline_bot]).unwrap(),
2767-
nostr::Tag::custom(
2768-
nostr::TagKind::Custom("mention".into()),
2769-
[&offline_bot],
2770-
),
2767+
nostr::Tag::custom(nostr::TagKind::Custom("mention".into()), [&offline_bot]),
27712768
]);
27722769
assert_eq!(
27732770
crate::handlers::event::explicit_mention_pubkeys_from_tags(&intentional),
@@ -2780,9 +2777,7 @@ mod tests {
27802777
let mentioned =
27812778
crate::handlers::event::explicit_mention_pubkeys_from_tags(&intentional);
27822779
assert_eq!(
2783-
crate::handlers::event::select_offline_mentioned_bots(
2784-
&mentioned, &bots, &present
2785-
),
2780+
crate::handlers::event::select_offline_mentioned_bots(&mentioned, &bots, &present),
27862781
vec![offline_bot]
27872782
);
27882783
}
@@ -2801,15 +2796,15 @@ mod tests {
28012796

28022797
// human p only → not selected (not bot)
28032798
assert!(crate::handlers::event::select_offline_mentioned_bots(
2804-
&[human.clone()],
2799+
std::slice::from_ref(&human),
28052800
&bots,
28062801
&present
28072802
)
28082803
.is_empty());
28092804

28102805
// online agent → no notice
28112806
assert!(crate::handlers::event::select_offline_mentioned_bots(
2812-
&[online_bot.clone()],
2807+
std::slice::from_ref(&online_bot),
28132808
&bots,
28142809
&present
28152810
)
@@ -2818,7 +2813,7 @@ mod tests {
28182813
// offline agent → exactly one
28192814
assert_eq!(
28202815
crate::handlers::event::select_offline_mentioned_bots(
2821-
&[offline_bot.clone()],
2816+
std::slice::from_ref(&offline_bot),
28222817
&bots,
28232818
&present
28242819
),

crates/buzz-relay/src/workflow_sink.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,9 @@ impl ActionSink for RelayActionSink {
296296
Tag::parse(["p", &mentioned])
297297
.map_err(|e| ActionSinkError::EventBuild(format!("mention p tag: {e}")))?,
298298
);
299-
tags.push(
300-
Tag::parse(["mention", &mentioned]).map_err(|e| {
301-
ActionSinkError::EventBuild(format!("mention intent tag: {e}"))
302-
})?,
303-
);
299+
tags.push(Tag::parse(["mention", &mentioned]).map_err(|e| {
300+
ActionSinkError::EventBuild(format!("mention intent tag: {e}"))
301+
})?);
304302
}
305303

306304
let kind = Kind::from(KIND_STREAM_MESSAGE as u16);

0 commit comments

Comments
 (0)