Skip to content

Commit

Permalink
derived data service: Migrate 2ds_client from structopt to latest clap
Browse files Browse the repository at this point in the history
Summary:
I found this code that still used structopt  as the `arg_enum!` macro caused a clippy warning:
```
warning: useless use of `vec!`
  --> third-party/rust/vendor/clap-2.34.0/src/macros.rs:317:1
   |
   = note: in this expansion of `arg_enum!` (#1)
   |
   = note: in this expansion of `arg_enum!` (#2)
  ::: third-party/rust/vendor/clap-2.34.0/src/macros.rs:380:9
   |
   = note: in this macro invocation (#2)
   |
  ::: fbcode/eden/mononoke/facebook/derived_data_service/client/main.rs:33:1
   |
33 | / arg_enum! {
34 | |     #[derive(Debug)]
35 | |     enum ArgDerivationTypes {
36 | |         Single,
...  |
39 | |     }
40 | | }
   | |_- in this macro invocation (#1)
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
   = note: `#[warn(clippy::useless_vec)]` on by default

warning: 1 warning emitted
```

Time to move-on.

We try to minimize behaviour changes as this diff is a refactoring.
However, the derivation type now expects a lowercase argument as that's the default behaviour for ValueEnum. We're not going out of our way to stick to the old behaviour and update the tests instead.

Reviewed By: mitrandir77

Differential Revision: D51109785

fbshipit-source-id: 8ad55f842466c2305e97b85c7a733d2840d41b90
  • Loading branch information
Pierre Chevalier authored and facebook-github-bot committed Nov 8, 2023
1 parent 8ddd002 commit 7a44dfa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions eden/mononoke/facebook/derived_data_service/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ rust_binary(
srcs = glob(["client/**/*.rs"]),
deps = [
"fbsource//third-party/rust:anyhow",
"fbsource//third-party/rust:clap-2",
"fbsource//third-party/rust:clap",
"fbsource//third-party/rust:env_logger",
"fbsource//third-party/rust:futures",
"fbsource//third-party/rust:log",
"fbsource//third-party/rust:structopt",
":derived_data_client_library",
"//common/rust/shed/fbinit:fbinit",
"//common/rust/shed/fbinit:fbinit-tokio",
Expand Down

0 comments on commit 7a44dfa

Please sign in to comment.