1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

deps ~ change from 'humantime_to_duration' to 'parse_datetime'

This commit is contained in:
Roy Ivy III 2023-06-11 10:35:32 -05:00 committed by Daniel Hofstetter
parent a5272e1344
commit 9aef5ac35b
3 changed files with 5 additions and 6 deletions

View file

@ -1,7 +1,7 @@
# coreutils (uutils)
# * see the repository LICENSE, README, and CONTRIBUTING files for more information
# spell-checker:ignore (libs) libselinux gethostid procfs bigdecimal kqueue fundu mangen datetime uuhelp memmap
# spell-checker:ignore (libs) bigdecimal datetime fundu gethostid kqueue libselinux mangen memmap procfs uuhelp
[package]
name = "coreutils"

View file

@ -1,4 +1,4 @@
# spell-checker:ignore humantime
# spell-checker:ignore datetime
[package]
name = "uu_touch"
version = "0.0.19"
@ -18,8 +18,7 @@ path = "src/touch.rs"
[dependencies]
filetime = { workspace = true }
clap = { workspace = true }
# TODO: use workspace dependency (0.3) when switching from time to chrono
humantime_to_duration = "0.2.1"
parse_datetime = { workspace = true }
time = { workspace = true, features = [
"parsing",
"formatting",

View file

@ -84,7 +84,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
) {
(Some(reference), Some(date)) => {
let (atime, mtime) = stat(Path::new(reference), !matches.get_flag(options::NO_DEREF))?;
if let Ok(offset) = humantime_to_duration::from_str(date) {
if let Ok(offset) = parse_datetime::from_str(date) {
let mut seconds = offset.whole_seconds();
let mut nanos = offset.subsec_nanoseconds();
if nanos < 0 {
@ -445,7 +445,7 @@ fn parse_date(s: &str) -> UResult<FileTime> {
}
}
if let Ok(duration) = humantime_to_duration::from_str(s) {
if let Ok(duration) = parse_datetime::from_str(s) {
let now_local = time::OffsetDateTime::now_local().unwrap();
let diff = now_local.checked_add(duration).unwrap();
return Ok(local_dt_to_filetime(diff));