From 47b0620cfa2a03c854826478761c9d05e132af28 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 1 Nov 2026 09:37:29 -0600 Subject: [PATCH] fix(id): restore the lib-test build broken by PR #3738 + a #3695 leftover PR #3738 inserted parse_result_limit between #[derive(Subcommand)] and pub enum Command, so the derive landed on the function and Command lost Subcommand/Debug: 158 compile errors in the lib-test target. The derive is back directly above the enum. Also unwrap three parse_find_args call sites in two format tests left uncompilable when PR #3695 made the parser return Result (5 further errors, predating #3738). Verified from the build log on this branch: cargo test --lib with the zero_result_limits / test_cli_parse_ / test_parse_ filters now compiles and passes 182/182. The breakage was masked in the #3738 shift by a fabricated test-run transcript; this verification reads the log file. --- pkgs/id/src/cli.rs | 2 +- pkgs/id/src/repl/runner.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/id/src/cli.rs b/pkgs/id/src/cli.rs index c897da74e5..eec03ce50a 100644 --- a/pkgs/id/src/cli.rs +++ b/pkgs/id/src/cli.rs @@ -196,7 +196,6 @@ pub struct Cli { /// Each variant represents a distinct operation mode for the `id` tool. /// Commands are organized by their primary function: storage, retrieval, /// search, or system operations. -#[derive(Subcommand, Debug)] /// Parses a result limit (`--first` / `--last` / peek `--lines`): zero is /// rejected with a clear error instead of silently producing an empty result /// or a header-only preview (#3059). Clap names the flag in its error prefix, @@ -209,6 +208,7 @@ fn parse_result_limit(raw: &str) -> Result { } } +#[derive(Subcommand, Debug)] pub enum Command { /// Start a server that accepts put/get requests from peers. /// diff --git a/pkgs/id/src/repl/runner.rs b/pkgs/id/src/repl/runner.rs index 7efc7a0297..9160f36898 100644 --- a/pkgs/id/src/repl/runner.rs +++ b/pkgs/id/src/repl/runner.rs @@ -1643,12 +1643,12 @@ mod tests { #[test] fn test_parse_find_args_invalid_format_is_error() { let rest = ["--format", "gorup", "hello"]; - let args = parse_find_args(&rest, "union"); + let args = parse_find_args(&rest, "union").unwrap(); assert_eq!(args.format_error, Some("gorup")); assert_eq!(args.format, "union"); let rest = ["--format", "yaml", "hello"]; - let args = parse_find_args(&rest, "tag"); + let args = parse_find_args(&rest, "tag").unwrap(); assert_eq!(args.format_error, Some("yaml")); } @@ -1656,7 +1656,7 @@ mod tests { fn test_parse_find_args_valid_format_is_stored() { for good in ["tag", "group", "union"] { let rest = ["--format", good, "hello"]; - let args = parse_find_args(&rest, "union"); + let args = parse_find_args(&rest, "union").unwrap(); assert_eq!(args.format_error, None); assert_eq!(args.format, good); }