Skip to content

Commit cdbc4ec

Browse files
Bartok9Bartok9
authored andcommitted
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> (cherry picked from commit 75f5a1d) Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com> (cherry picked from commit 3422092) Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com> (cherry picked from commit 72d5a79) Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com> (cherry picked from commit 42a445f) Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
1 parent 91c7f10 commit cdbc4ec

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
@@ -2773,10 +2773,7 @@ mod tests {
27732773
nostr::Tag::parse(["p", &author]).unwrap(),
27742774
nostr::Tag::parse(["h", "00000000-0000-0000-0000-000000000001"]).unwrap(),
27752775
nostr::Tag::parse(["p", &offline_bot]).unwrap(),
2776-
nostr::Tag::custom(
2777-
nostr::TagKind::Custom("mention".into()),
2778-
[&offline_bot],
2779-
),
2776+
nostr::Tag::custom(nostr::TagKind::Custom("mention".into()), [&offline_bot]),
27802777
]);
27812778
assert_eq!(
27822779
crate::handlers::event::explicit_mention_pubkeys_from_tags(&intentional),
@@ -2789,9 +2786,7 @@ mod tests {
27892786
let mentioned =
27902787
crate::handlers::event::explicit_mention_pubkeys_from_tags(&intentional);
27912788
assert_eq!(
2792-
crate::handlers::event::select_offline_mentioned_bots(
2793-
&mentioned, &bots, &present
2794-
),
2789+
crate::handlers::event::select_offline_mentioned_bots(&mentioned, &bots, &present),
27952790
vec![offline_bot]
27962791
);
27972792
}
@@ -2810,15 +2805,15 @@ mod tests {
28102805

28112806
// human p only → not selected (not bot)
28122807
assert!(crate::handlers::event::select_offline_mentioned_bots(
2813-
&[human.clone()],
2808+
std::slice::from_ref(&human),
28142809
&bots,
28152810
&present
28162811
)
28172812
.is_empty());
28182813

28192814
// online agent → no notice
28202815
assert!(crate::handlers::event::select_offline_mentioned_bots(
2821-
&[online_bot.clone()],
2816+
std::slice::from_ref(&online_bot),
28222817
&bots,
28232818
&present
28242819
)
@@ -2827,7 +2822,7 @@ mod tests {
28272822
// offline agent → exactly one
28282823
assert_eq!(
28292824
crate::handlers::event::select_offline_mentioned_bots(
2830-
&[offline_bot.clone()],
2825+
std::slice::from_ref(&offline_bot),
28312826
&bots,
28322827
&present
28332828
),

crates/buzz-relay/src/workflow_sink.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,9 @@ impl ActionSink for RelayActionSink {
397397
Tag::parse(["p", &mentioned])
398398
.map_err(|e| ActionSinkError::EventBuild(format!("mention p tag: {e}")))?,
399399
);
400-
tags.push(
401-
Tag::parse(["mention", &mentioned]).map_err(|e| {
402-
ActionSinkError::EventBuild(format!("mention intent tag: {e}"))
403-
})?,
404-
);
400+
tags.push(Tag::parse(["mention", &mentioned]).map_err(|e| {
401+
ActionSinkError::EventBuild(format!("mention intent tag: {e}"))
402+
})?);
405403
}
406404
>>>>>>> d8b6d0d (fix(mention): emit parallel p + mention tags on intentional @mentions)
407405

0 commit comments

Comments
 (0)