mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
tail: fix compile error due to fundu update
This commit is contained in:
parent
ccee02f025
commit
b6c02c1a23
1 changed files with 10 additions and 7 deletions
|
@ -9,7 +9,7 @@ use crate::paths::Input;
|
||||||
use crate::{parse, platform, Quotable};
|
use crate::{parse, platform, Quotable};
|
||||||
use clap::crate_version;
|
use clap::crate_version;
|
||||||
use clap::{Arg, ArgAction, ArgMatches, Command};
|
use clap::{Arg, ArgAction, ArgMatches, Command};
|
||||||
use fundu::DurationParser;
|
use fundu::{DurationParser, SaturatingInto};
|
||||||
use is_terminal::IsTerminal;
|
use is_terminal::IsTerminal;
|
||||||
use same_file::Handle;
|
use same_file::Handle;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
|
@ -235,12 +235,15 @@ impl Settings {
|
||||||
// `DURATION::MAX` or `infinity` was given
|
// `DURATION::MAX` or `infinity` was given
|
||||||
// * not applied here but it supports customizable time units and provides better error
|
// * not applied here but it supports customizable time units and provides better error
|
||||||
// messages
|
// messages
|
||||||
settings.sleep_sec =
|
settings.sleep_sec = match DurationParser::without_time_units().parse(source) {
|
||||||
DurationParser::without_time_units()
|
Ok(duration) => SaturatingInto::<std::time::Duration>::saturating_into(duration),
|
||||||
.parse(source)
|
Err(_) => {
|
||||||
.map_err(|_| {
|
return Err(UUsageError::new(
|
||||||
UUsageError::new(1, format!("invalid number of seconds: '{source}'"))
|
1,
|
||||||
})?;
|
format!("invalid number of seconds: '{source}'"),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(s) = matches.get_one::<String>(options::MAX_UNCHANGED_STATS) {
|
if let Some(s) = matches.get_one::<String>(options::MAX_UNCHANGED_STATS) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue