Skip to content

Fix CI: checkin_bom tests use std::slice::from_ref (clippy) - #462

Merged
WARR-eV merged 2 commits into
mainfrom
fix-clippy-checkin-bom
Nov 22, 2026
Merged

WARR-eV merged 2 commits into
mainfrom
fix-clippy-checkin-bom

Conversation

@rudalabs

Copy link
Copy Markdown
Collaborator

The lint job (fmt and clippy) on main fails since 309a06b: clippy refuses [x.clone()] for a one-element array to compare with (cloned_ref_to_slice_refs), seven places in tests/checkin_bom.rs (#407). They use std::slice::from_ref(&x) now.

Checked locally this time to the end, not error by error: cargo clippy --all-targets --locked -- -D warnings is clean for the server and the desktop app, cargo fmt applied. CHANGELOG entry.

🤖 Generated with Claude Code

rudalabs and others added 2 commits November 22, 2026 23:18
…t.mjs

old mode 100644
new mode 100755
diff --git a/tests/checkin_bom.rs b/tests/checkin_bom.rs
index 6d8aafe..7ae5886 100755
--- a/tests/checkin_bom.rs
+++ b/tests/checkin_bom.rs
@@ -253,11 +253,19 @@ async fn a_checkin_with_the_box_updates_the_bom_from_the_cad_file() {
     assert_eq!(r.status, StatusCode::OK, "{}", r.text());
     let body = r.json();
     let result = &body["bom"];
-    assert_eq!(strings(&result["added"]), [nut.clone()], "{body}");
-    assert_eq!(strings(&result["updated"]), [bolt.clone()], "{body}");
+    assert_eq!(
+        strings(&result["added"]),
+        std::slice::from_ref(&nut),
+        "{body}"
+    );
+    assert_eq!(
+        strings(&result["updated"]),
+        std::slice::from_ref(&bolt),
+        "{body}"
+    );
     assert_eq!(
         strings(&result["kept_not_in_cad"]),
-        [glue.clone()],
+        std::slice::from_ref(&glue),
         "{body}"
     );
     assert_eq!(
@@ -292,7 +300,10 @@ async fn a_checkin_with_the_box_updates_the_bom_from_the_cad_file() {
     let again = r.json();
     assert_eq!(again["bom"]["added"], json!([]), "{again}");
     assert_eq!(again["bom"]["updated"], json!([]), "{again}");
-    assert_eq!(strings(&again["bom"]["kept_not_in_cad"]), [glue.clone()]);
+    assert_eq!(
+        strings(&again["bom"]["kept_not_in_cad"]),
+        std::slice::from_ref(&glue)
+    );
     assert_eq!(bom_audits(&app, rev).await.len(), 1);
     app.teardown().await;
 }
@@ -325,7 +336,11 @@ async fn an_assumed_quantity_never_overwrites_an_existing_line() {
     .await;
     assert_eq!(r.status, StatusCode::OK, "{}", r.text());
     let body = r.json();
-    assert_eq!(strings(&body["bom"]["added"]), [bolt.clone()], "{body}");
+    assert_eq!(
+        strings(&body["bom"]["added"]),
+        std::slice::from_ref(&bolt),
clippy refuses [x.clone()] for a one-element array to compare with
(cloned_ref_to_slice_refs); seven places in tests/checkin_bom.rs
failed the lint job on main (309a06b). Checked locally: clippy
--all-targets -D warnings is clean for the server and the desktop app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WARR-eV
WARR-eV merged commit 1d4ff48 into main Nov 22, 2026
5 checks passed
@WARR-eV
WARR-eV deleted the fix-clippy-checkin-bom branch November 22, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants