Run the formatter over the face branch before it reaches CI
🐳 Android image / Build and push (push) Successful in 2s
Build and test / android-image (push) Successful in 2s
Build and test / Desktop (Linux) (push) Successful in 1h21m32s
Build and test / Layer separation (push) Successful in 37s
Traceability / Requirement traces (push) Successful in 25s
Build and test / Android (aarch64) (push) Failing after 33m58s

The merge of the SCRFD/MobileFaceNet work brought 69 rustfmt diffs across
dr-catalog, dr-face and dr-ui with it, so `cargo fmt --all -- --check` fails
on master and the Desktop job stops at its Format step — before clippy, the
tests or the release build have run at all. That makes the whole desktop
half of CI blind: a real compile error behind this would look exactly the
same from the outside. There was nothing behind it, as it turns out — with
the formatting fixed, clippy, the test suite and the release build all pass.

Every .rs hunk is `cargo fmt --all` on the pinned 1.92.0 toolchain, not a
hand edit, but it is worth being precise about what that moved, because it
is more than whitespace. Besides reflowing signatures and call chains,
rustfmt reordered the `pub mod` and `pub use` items in dr-face/src/lib.rs so
the `#[cfg(feature = "inference")]` entries sort in place, added the trailing
semicolon inside `let ... else { return }` bodies in identity_ui.rs, wrapped
a bare closure body in braces in cluster.rs, adjusted trailing commas, and
dropped a stray blank line at the end of identity_ui.rs. All of it is
semantically inert; none of it changes behaviour.

docs/traceability.md rides along because it has to. The matrix records each
TRACES tag by line number, and reflowing develop.rs, lib.rs, faces.rs,
identity.rs and identity_ui.rs moved them — FR-CAT-8, FR-CAT-9, FR-CULL-10,
FR-DEV-3, FR-DEV-3a and FR-DEV-3c all shift by a line or two. The matrix was
verified up to date on d777f7f before this commit, so this is drift these
formatting changes introduced, not pre-existing staleness being swept up.
Leaving it for a follow-up commit would hand traceability-check.yml a
failure caused entirely by a whitespace change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-27 13:12:49 +02:00
co-authored by Claude Opus 5
parent d777f7f44d
commit b846b312b8
18 changed files with 285 additions and 207 deletions
+24 -7
View File
@@ -152,14 +152,20 @@ mod tests {
fn a_tiny_face_in_a_large_person_still_matches() {
let tall = (0.0, 0.0, 500.0, 2000.0);
let small = (240.0, 40.0, 280.0, 100.0);
assert_eq!(name_for_instance(tall, &[named(small, "Anna")]), Some("Anna"));
assert_eq!(
name_for_instance(tall, &[named(small, "Anna")]),
Some("Anna")
);
}
#[test]
fn a_face_mostly_outside_the_person_is_not_theirs() {
// Overlapping the person's edge, but only just.
let straddling = (60.0, 80.0, 140.0, 220.0);
assert_eq!(name_for_instance(PERSON, &[named(straddling, "Anna")]), None);
assert_eq!(
name_for_instance(PERSON, &[named(straddling, "Anna")]),
None
);
}
/// A tight portrait, where the segmenter's "person" is head and shoulders
@@ -175,7 +181,10 @@ mod tests {
fn a_tight_portrait_is_named_rather_than_treated_as_suspicious() {
let head = (100.0, 50.0, 400.0, 400.0);
let face = (110.0, 60.0, 390.0, 390.0);
assert_eq!(name_for_instance(head, &[named(face, "Anna")]), Some("Anna"));
assert_eq!(
name_for_instance(head, &[named(face, "Anna")]),
Some("Anna")
);
}
/// A face box *larger* than the instance is a genuine disagreement, and
@@ -185,7 +194,10 @@ mod tests {
fn a_face_larger_than_the_instance_does_not_name_it() {
let small_instance = (200.0, 200.0, 260.0, 260.0);
let huge_face = (100.0, 100.0, 500.0, 500.0);
assert_eq!(name_for_instance(small_instance, &[named(huge_face, "Anna")]), None);
assert_eq!(
name_for_instance(small_instance, &[named(huge_face, "Anna")]),
None
);
}
/// Two people merged into one blob: naming either would be a coin toss,
@@ -226,8 +238,14 @@ mod tests {
#[test]
fn degenerate_boxes_name_nothing_rather_than_panicking() {
assert_eq!(name_for_instance((0.0, 0.0, 0.0, 0.0), &[named(FACE, "A")]), None);
assert_eq!(name_for_instance(PERSON, &[named((5.0, 5.0, 5.0, 5.0), "A")]), None);
assert_eq!(
name_for_instance((0.0, 0.0, 0.0, 0.0), &[named(FACE, "A")]),
None
);
assert_eq!(
name_for_instance(PERSON, &[named((5.0, 5.0, 5.0, 5.0), "A")]),
None
);
assert_eq!(name_for_instance(PERSON, &[]), None);
}
@@ -282,4 +300,3 @@ mod tests {
assert_eq!(instances[0].class, "person");
}
}