From c3424dc5bae57f4cecdeaeaef7d5e2c77e139e5b Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:53:51 +0000 Subject: [PATCH] fix: use field assignment instead of struct literal for non-exhaustive Spec in benchmarks Benchmarks are compiled as separate crates, so constructing a #[non_exhaustive] struct with struct literal syntax causes E0639. Use Default::default() with field assignment instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/benches/parse.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/benches/parse.rs b/lib/benches/parse.rs index 72423a97..29c8a021 100644 --- a/lib/benches/parse.rs +++ b/lib/benches/parse.rs @@ -16,12 +16,11 @@ fn build_small_spec() -> Spec { .build(); cmd.subcommands.insert("install".to_string(), install_cmd); - Spec { - name: "test".to_string(), - bin: "test".to_string(), - cmd, - ..Default::default() - } + let mut spec = Spec::default(); + spec.name = "test".to_string(); + spec.bin = "test".to_string(); + spec.cmd = cmd; + spec } fn build_large_spec() -> Spec { @@ -85,12 +84,11 @@ fn build_large_spec() -> Spec { .build(); cmd.subcommands = subcommands; - Spec { - name: "bench".to_string(), - bin: "bench".to_string(), - cmd, - ..Default::default() - } + let mut spec = Spec::default(); + spec.name = "bench".to_string(); + spec.bin = "bench".to_string(); + spec.cmd = cmd; + spec } fn bench_parse_small_spec(c: &mut Criterion) {