Skip to content

Commit b50cbce

Browse files
committed
fix: Use jiff everywhere
1 parent a6f4589 commit b50cbce

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

Cargo.lock

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/backend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ log = { workspace = true }
5858
# other dependencies
5959
bytes = { workspace = true }
6060
derive_setters = "0.1.8"
61-
humantime = "2.3.0"
61+
jiff = { version = "0.2.16" }
6262
itertools = "0.14.0"
6363
strum = "0.27"
6464
strum_macros = "0.27"

crates/backend/src/rest.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::time::Duration;
44

55
use backon::{BlockingRetryable, ExponentialBuilder};
66
use bytes::Bytes;
7+
use jiff::SignedDuration;
78
use log::{trace, warn};
89
use reqwest::{
910
Url,
@@ -186,15 +187,18 @@ impl RestBackend {
186187
};
187188
backoff = backoff.with_max_times(max_retries);
188189
} else if option == "timeout" {
189-
timeout = *humantime::Duration::from_str(&value).map_err(|err| {
190+
timeout = SignedDuration::from_str(&value).map_err(|err| {
190191
RusticError::with_source(
191192
ErrorKind::InvalidInput,
192-
"Could not parse value `{value}` as `humantime` duration. Invalid value for option `{option}`.",
193+
"Could not parse value `{value}` as duration. Invalid value for option `{option}`.",
193194
err,
194195
)
195196
.attach_context("value", value)
196197
.attach_context("option", "timeout")
197-
})?;
198+
})?.try_into()
199+
// ignore conversation errors, but print out warning
200+
.inspect_err(|err| warn!("cannot use timeout: {err}"))
201+
.unwrap_or_default();
198202
} else if option == "cacert" {
199203
client_builder = client_builder.add_root_certificate(get_cacert(&value)?);
200204
} else if option == "tls-client-cert" {

crates/core/src/repository/warm_up.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub(crate) fn warm_up_wait<P: ProgressBars, S>(
4343
wait.try_into()
4444
// ignore conversation errors, but print out warning
4545
.inspect_err(|err| warn!("cannot wait for warm-up: {err}"))
46-
.unwrap(),
46+
.unwrap_or_default(),
4747
);
4848
p.finish();
4949
}

0 commit comments

Comments
 (0)