Skip to content

Conversation

@Yuvraj-cyborg
Copy link
Contributor

Which issue does this PR close?

Closes - #19482
(Part of #19072 )

Rationale for this change

The structopt crate is deprecated and has been superseded by clap with its derive feature.
This migration:

  • Removes a deprecated dependency
  • Potentially improves compilation times for the benchmarks crate
  • Keeps the codebase up-to-date with modern Rust ecosystem practices

What changes are included in this PR?

  • Updated Cargo.toml to use clap = { version = "4.5.53", features = ["derive"] } instead of structopt

  • Migrated all benchmark source files to use clap's derive macros:

  • #[derive(StructOpt)]#[derive(Parser/Args/Subcommand)]

  • #[structopt(...)]#[arg(...)] for fields

  • #[structopt(...)]#[command(...)] for struct/enum-level attributes

  • StructOpt::from_args()Parser::parse()

  • Removed parse(from_os_str) as PathBuf works natively in clap

  • Changed short flag strings to chars ('p' instead of "p")

Are these changes tested?

Yes

Are there any user-facing changes?

No. The CLI interface remains identical - this is a drop-in replacement of the underlying argument parsing library.

@Yuvraj-cyborg
Copy link
Contributor Author

cc: @alamb @Jefffrey @martin-g @timsaucer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant