chiark / gitweb /
clap: use value_parser
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 19:02:30 +0000 (20:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 20:15:29 +0000 (21:15 +0100)
Removes a deprecation warning (this is recommended by the clap 3 to 4
migration guide).

    warning: use of deprecated function `<reporter::LogOpts as clap::Args>::augment_args::parse_try_from_str`: Replaced with `#[clap(value_parser = ...)]`
      --> src/reporter.rs:22:35
       |
    22 |   #[clap(long, parse(try_from_str=parse_syslog_facility))]
       |                                   ^^^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(deprecated)]` on by default

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/reporter.rs

index cc2d098a94dfacdf4d8fb4cdd6d6a9cd570c044e..599c14665c1cefad97b32e8561535136b2fad3d4 100644 (file)
@@ -19,7 +19,7 @@ pub struct LogOpts {
   debug: u8,
 
   /// Syslog facility to use
-  #[clap(long, parse(try_from_str=parse_syslog_facility))]
+  #[clap(long, value_parser=parse_syslog_facility)]
   syslog_facility: Option<syslog::Facility>,
 }