From 2841eaf9a1e5c2e0bbb058816d8e739618a13801 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 5 Sep 2026 15:14:15 +0200 Subject: [PATCH] Take the layer-chain test's closure down to &dyn Operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `clippy::borrowed_box` is denied by the workspace lint set, and the closure added with the optics exclusion took `&Box` — a borrow of the box rather than of the thing in it, which says nothing the plain trait object does not. Caught by `cargo clippy --workspace --all-targets -- -D warnings`, which is what CI runs and what the workspace tests do not: a lint on test code only appears when the tests are compiled as a clippy target. Co-Authored-By: Claude Opus 5 (1M context) --- core/dr-pipeline/src/mask.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/dr-pipeline/src/mask.rs b/core/dr-pipeline/src/mask.rs index 86b2db2..29f752b 100644 --- a/core/dr-pipeline/src/mask.rs +++ b/core/dr-pipeline/src/mask.rs @@ -1500,7 +1500,7 @@ mod tests { let ids: Vec<&str> = layer.capabilities().iter().map(|c| c.id.0).collect(); let global = crate::ops::chain(); - let local_means_something = |op: &Box| { + let local_means_something = |op: &dyn Operation| { op.detail().is_none() && !op .descriptor() @@ -1512,14 +1512,15 @@ mod tests { let id = op.descriptor().id.0; assert_eq!( ids.contains(&id), - local_means_something(op), + local_means_something(op.as_ref()), "{id} is offered as a local adjustment but cannot meaningfully \ be one, or is an ordinary point operation and has gone \ missing from a layer" ); } assert!( - ids.len() < global.len() || global.iter().all(local_means_something), + ids.len() < global.len() + || global.iter().all(|op| local_means_something(op.as_ref())), "the filter dropped nothing, so either it is not running or the \ chain has nothing left that a layer cannot carry" );