From 7e2d051858c0c1362556adeddb9fa8576eab3e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20U=C5=9Bcinowicz?= Date: Sun, 22 Nov 2026 23:18:22 +0100 Subject: [PATCH 1/2] diff --git a/scripts/viewer-input.test.mjs b/scripts/viewer-input.test.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), --- scripts/viewer-input.test.mjs | 0 tests/checkin_bom.rs | 37 ++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) mode change 100644 => 100755 scripts/viewer-input.test.mjs diff --git a/scripts/viewer-input.test.mjs b/scripts/viewer-input.test.mjs old mode 100644 new mode 100755 diff --git a/tests/checkin_bom.rs b/tests/checkin_bom.rs index 6d8aafe8..7ae58866 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), + "{body}" + ); assert_eq!(body["bom"]["updated"], json!([]), "assumed: {body}"); let mut expected = vec![(bolt.clone(), 1.0), (plate.clone(), 3.0)]; expected.sort_by(|a, b| a.0.cmp(&b.0)); @@ -361,7 +376,11 @@ async fn a_circular_child_is_refused_at_checkin() { .await; assert_eq!(r.status, StatusCode::OK, "{}", r.text()); let body = r.json(); - assert_eq!(strings(&body["bom"]["added"]), [part.clone()], "{body}"); + assert_eq!( + strings(&body["bom"]["added"]), + std::slice::from_ref(&part), + "{body}" + ); assert_eq!(body["bom"]["refused"][0]["child"], json!(sub), "{body}"); assert!(body["bom"]["refused"][0]["reason"] .as_str() @@ -509,7 +528,11 @@ async fn a_chunked_checkin_updates_the_bom_too() { .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), + "{body}" + ); assert_eq!(bom(&app, &eng, &asm).await, [(bolt.clone(), 3.0)]); app.teardown().await; } From 8e2371e2540c3766affd1e3a7696e9beacea5482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20U=C5=9Bcinowicz?= Date: Sun, 22 Nov 2026 23:18:54 +0100 Subject: [PATCH 2/2] Fix CI: checkin_bom tests use std::slice::from_ref (clippy) 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 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd937b30..1b9520ef 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ see the notices in the README. ## [Unreleased] +### Fixed + +- CI: `tests/checkin_bom.rs` (#407) compared with one-element arrays built + by `[x.clone()]`, which clippy refuses (`cloned_ref_to_slice_refs`); it + uses `std::slice::from_ref` now. Server and desktop are clippy-clean on + all targets. + ### Added - **Panning in the 3D viewer** (#459), in the browser and the desktop app: