From 7a44dfa14f902d2cb309c1ce4924ecb6ce11ca36 Mon Sep 17 00:00:00 2001 From: Pierre Chevalier Date: Wed, 8 Nov 2023 08:32:36 -0800 Subject: [PATCH] derived data service: Migrate 2ds_client from structopt to latest clap 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 --- eden/mononoke/facebook/derived_data_service/TARGETS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eden/mononoke/facebook/derived_data_service/TARGETS b/eden/mononoke/facebook/derived_data_service/TARGETS index 6a592b5041ebd..be2cb72f69a21 100644 --- a/eden/mononoke/facebook/derived_data_service/TARGETS +++ b/eden/mononoke/facebook/derived_data_service/TARGETS @@ -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",