Merge pull request #4145 from niyaznigmatullin/chrono-0.4.23

build(deps): bump chrono from 0.4.22 to 0.4.23 + fix clippy warning
This commit is contained in:
Sylvestre Ledru 2022-11-15 23:14:14 +01:00 committed by GitHub
commit 6f8fced8ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 8 deletions

4
Cargo.lock generated
View file

@ -233,9 +233,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.22"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1"
checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
dependencies = [
"iana-time-zone",
"num-integer",

View file

@ -384,7 +384,7 @@ yes = { optional=true, version="0.0.16", package="uu_yes", path="src/uu/yes
#pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)
[dev-dependencies]
chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]}
chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]}
conv = "0.3"
filetime = "0.2"
glob = "0.3.0"

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/date.rs"
[dependencies]
chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]}
chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]}
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/du.rs"
[dependencies]
chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]}
chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]}
# For the --exclude & --exclude-from options
glob = "0.3.0"
clap = { version = "4.0", features = ["wrap_help", "cargo"] }

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/ls.rs"
[dependencies]
chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]}
chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]}
clap = { version = "4.0", features = ["wrap_help", "cargo", "env"] }
unicode-width = "0.1.8"
number_prefix = "0.4"

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/uptime.rs"
[dependencies]
chrono = { version="^0.4.19", default-features=false, features=["std", "alloc", "clock"]}
chrono = { version="^0.4.23", default-features=false, features=["std", "alloc", "clock"]}
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["libc", "utmpx"] }

View file

@ -44,7 +44,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Err(USimpleError::new(1, "could not retrieve system uptime"))
} else {
if matches.get_flag(options::SINCE) {
let initial_date = Local.timestamp(Utc::now().timestamp() - uptime, 0);
let initial_date = Local
.timestamp_opt(Utc::now().timestamp() - uptime, 0)
.unwrap();
println!("{}", initial_date.format("%Y-%m-%d %H:%M:%S"));
return Ok(());
}