Removes a deprecation warning (this is recommended by the clap 3 to 4
migration guide).
Checking hippotat v1.1.7 (/volatile/rustcargo/Rustup/Hippotat/hippotat)
warning: use of deprecated function `<reporter::LogOpts as clap::Args>::augment_args::parse_from_occurrences`: Replaced with `#[clap(action = ArgAction::Count)]` with a field type of `u8`
--> src/reporter.rs:18:33
|
18 | #[clap(long, short='D', parse(from_occurrences))]
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
/// and two -`D` means to send to syslog even messages from lower layers
/// (normally just the hippotat modules log to
/// syslog).
- #[clap(long, short='D', parse(from_occurrences))]
- debug: usize,
+ #[clap(long, short='D', action=clap::ArgAction::Count)]
+ debug: u8,
/// Syslog facility to use
#[clap(long, parse(try_from_str=parse_syslog_facility))]
#[derive(Debug)]
struct LogWrapper<T>{
- debug: usize,
+ debug: u8,
output: T,
}
logb.filter(Some("hippotat"),
*[ log::LevelFilter::Info,
log::LevelFilter::Debug ]
- .get(self.debug)
+ .get(usize::from(self.debug))
.unwrap_or(
&log::LevelFilter::Trace
));