Skip to content

Commit

Permalink
Remove PartialEq implementations from CLI flags
Browse files Browse the repository at this point in the history
These are historical artifacts from when the pre-Wasmtime-13 CLI was
supported but they're no longer needed nowadays.
  • Loading branch information
alexcrichton committed Nov 20, 2024
1 parent 3e0b7e5 commit b992cb6
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 34 deletions.
28 changes: 0 additions & 28 deletions crates/cli-flags/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,31 +912,3 @@ impl CommonOptions {
Ok(())
}
}

impl PartialEq for CommonOptions {
fn eq(&self, other: &CommonOptions) -> bool {
let mut me = self.clone();
me.configure();
let mut other = other.clone();
other.configure();
let CommonOptions {
opts_raw: _,
codegen_raw: _,
debug_raw: _,
wasm_raw: _,
wasi_raw: _,
configured: _,

opts,
codegen,
debug,
wasm,
wasi,
} = me;
opts == other.opts
&& codegen == other.codegen
&& debug == other.debug
&& wasm == other.wasm
&& wasi == other.wasi
}
}
2 changes: 1 addition & 1 deletion src/commands/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AFTER_HELP: &str =
wasmtime compile --target x86_64-unknown-linux -Ccranelift-skylake foo.wasm\n";

/// Compiles a WebAssembly module.
#[derive(Parser, PartialEq)]
#[derive(Parser)]
#[command(
version,
after_help = AFTER_HELP,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/explore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use wasmtime::Strategy;
use wasmtime_cli_flags::CommonOptions;

/// Explore the compilation of a WebAssembly module to native code.
#[derive(Parser, PartialEq)]
#[derive(Parser)]
pub struct ExploreCommand {
#[command(flatten)]
common: CommonOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn parse_preloads(s: &str) -> Result<(String, PathBuf)> {
}

/// Runs a WebAssembly module
#[derive(Parser, PartialEq)]
#[derive(Parser)]
pub struct RunCommand {
#[command(flatten)]
#[allow(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const DEFAULT_ADDR: std::net::SocketAddr = std::net::SocketAddr::new(
);

/// Runs a WebAssembly module
#[derive(Parser, PartialEq)]
#[derive(Parser)]
pub struct ServeCommand {
#[command(flatten)]
run: RunCommon,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use wasmtime_cli_flags::CommonOptions;
use wasmtime_wast::{SpectestConfig, WastContext};

/// Runs a WebAssembly test script file
#[derive(Parser, PartialEq)]
#[derive(Parser)]
pub struct WastCommand {
#[command(flatten)]
common: CommonOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl RunTarget {
}

/// Common command line arguments for run commands.
#[derive(Parser, PartialEq)]
#[derive(Parser)]
pub struct RunCommon {
#[command(flatten)]
pub common: CommonOptions,
Expand Down

0 comments on commit b992cb6

Please sign in to comment.