From 50b978cd8bf82950cd6bdd34f8109c413e17e1b5 Mon Sep 17 00:00:00 2001 From: Eureka Date: Tue, 17 Nov 2026 01:55:43 +0000 Subject: [PATCH] desk, import: pass fn item to map, is_multiple_of, drop format! of a literal (clippy) Co-Authored-By: Claude Sonnet 5.5 --- crates/huginn-mind/src/desk.rs | 2 +- crates/huginn-mind/src/import.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/huginn-mind/src/desk.rs b/crates/huginn-mind/src/desk.rs index 89d8e01..9c41d37 100644 --- a/crates/huginn-mind/src/desk.rs +++ b/crates/huginn-mind/src/desk.rs @@ -1468,7 +1468,7 @@ mod tests { let before = head(&mind); let id = request.request_id.clone(); let (answer, outcome) = stored(ask(&mut mind, &decider("y"), request.clone())); - assert_eq!(outcome, DeskOutcome::Refused { code: DeskRefusal::BadRetraction, retracts: sent.2.map(|target| s(target)) }, "{what}"); + assert_eq!(outcome, DeskOutcome::Refused { code: DeskRefusal::BadRetraction, retracts: sent.2.map(s) }, "{what}"); assert_eq!(head(&mind), before + 1, "{what} is stored"); // The record keeps what was sent: the choice, the note and the target it named. let record = held(&mind, &answer); diff --git a/crates/huginn-mind/src/import.rs b/crates/huginn-mind/src/import.rs index e689154..c1e68e2 100644 --- a/crates/huginn-mind/src/import.rs +++ b/crates/huginn-mind/src/import.rs @@ -150,7 +150,7 @@ mod tests { fn view(document: PipelineDocument, ordinal: u64) -> PipelineDocumentView { let key = pipeline_key(&document).unwrap(); let id = PipelineRef { kind: document.kind(), id: s(&key) }; - let faculty = if ordinal % 2 == 0 { Faculty::Hands } else { Faculty::Soul }; + let faculty = if ordinal.is_multiple_of(2) { Faculty::Hands } else { Faculty::Soul }; let admission = AdmissionFacts { receipt_id: format!("receipt-{ordinal}"), admitted_at: format!("2026-11-08T16:{ordinal:02}:00Z"), @@ -226,7 +226,7 @@ mod tests { let to_source = [held.clone(), vec![moved(RECEIVER, 4)]].concat(); assert_eq!(plan(&slug(CAMPAIGN), &slug(RECEIVER), &slug(RECEIVER), to_source), Err(ImportFault::SourceIsReceiver)); let other_root = view( - resolution(r(K::Campaign, &format!("elsewhere:campaign:self")), ResolutionOutcome::Moved { to: slug(RECEIVER) }), + resolution(r(K::Campaign, "elsewhere:campaign:self"), ResolutionOutcome::Moved { to: slug(RECEIVER) }), 4, ); assert_eq!(plan_of([held, vec![other_root]].concat()), Err(ImportFault::NotMoved), "another root's move does not move this one");