From 6285c5949cf998f5862afcd607affa2506e64ecc Mon Sep 17 00:00:00 2001 From: Lawrence Chou Date: Tue, 4 Oct 2022 20:59:57 +0800 Subject: [PATCH] Fix clap v4 deprecation warning Following the 3. stap of [clap v4 migration instructions](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#migrating) The result for 'cargo check --features clap/deprecated' is https://user-images.githubusercontent.com/12410942/193825216-ac680574-f53b-49c0-88c4-8bc42c4c6381.png --- meilisearch-http/src/option.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index a47a2b211..f4678d725 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -82,7 +82,7 @@ pub struct Opt { pub master_key: Option, /// Configures the instance's environment. Value must be either `production` or `development`. - #[clap(long, env = MEILI_ENV, default_value_t = default_env(), possible_values = &POSSIBLE_ENV)] + #[clap(long, env = MEILI_ENV, default_value_t = default_env(), value_parser = POSSIBLE_ENV)] #[serde(default = "default_env")] pub env: String, @@ -115,24 +115,24 @@ pub struct Opt { /// Sets the server's SSL certificates. #[serde(skip_serializing)] - #[clap(long, env = MEILI_SSL_CERT_PATH, parse(from_os_str))] + #[clap(long, env = MEILI_SSL_CERT_PATH, value_parser)] pub ssl_cert_path: Option, /// Sets the server's SSL key files. #[serde(skip_serializing)] - #[clap(long, env = MEILI_SSL_KEY_PATH, parse(from_os_str))] + #[clap(long, env = MEILI_SSL_KEY_PATH, value_parser)] pub ssl_key_path: Option, /// Enables client authentication in the specified path. #[serde(skip_serializing)] - #[clap(long, env = MEILI_SSL_AUTH_PATH, parse(from_os_str))] + #[clap(long, env = MEILI_SSL_AUTH_PATH, value_parser)] pub ssl_auth_path: Option, /// Sets the server's OCSP file. *Optional* /// /// Reads DER-encoded OCSP response from OCSPFILE and staple to certificate. #[serde(skip_serializing)] - #[clap(long, env = MEILI_SSL_OCSP_PATH, parse(from_os_str))] + #[clap(long, env = MEILI_SSL_OCSP_PATH, value_parser)] pub ssl_ocsp_path: Option, /// Makes SSL authentication mandatory.