Skip to content

Commit 32ea4d9

Browse files
committed
Resolve clippy nightly lints
1 parent 1d0557d commit 32ea4d9

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,14 @@ impl Config {
712712
fn validate(&mut self) -> anyhow::Result<()> {
713713
// TODO: check bind_addr.is_documentation() once stable: https://github.com/rust-lang/rust/issues/27709
714714

715-
if self.database_slow_timeout > Duration::from_secs(60) {
715+
if self.database_slow_timeout > Duration::from_mins(1) {
716716
bail!(
717717
"Invalid database_slow_timeout value of {}: must be less or equal to 60s",
718718
self.database_slow_timeout.as_secs_f32()
719719
);
720720
}
721721

722-
if self.http_timeout > Duration::from_secs(360) {
722+
if self.http_timeout > Duration::from_mins(6) {
723723
bail!(
724724
"Invalid http_timeout value of {}: must be less or equal to 360s",
725725
self.http_timeout.as_secs_f32()

src/humanfmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ mod tests {
210210
"1d1s"
211211
);
212212
assert_eq!(
213-
format!("{}", HumanFmt::Time(Duration::from_secs(86460))),
213+
format!("{}", HumanFmt::Time(Duration::from_mins(1441))),
214214
"1d1m"
215215
);
216216
assert_eq!(

src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const APP_NAME: &str = env!("CARGO_PKG_NAME");
158158
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
159159
const APP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),);
160160

161-
const RETENTION_TIME: Duration = Duration::from_secs(8 * 7 * 24 * 60 * 60); /* 8 weeks */
161+
const RETENTION_TIME: Duration = Duration::from_hours(8 * 7 * 24); /* 8 weeks */
162162

163163
const VOLATILE_UNKNOWN_CONTENT_LENGTH_UPPER: NonZero<u64> = nonzero!(1024 * 1024); /* 1MiB */
164164

@@ -3620,9 +3620,8 @@ async fn main_loop() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
36203620
let mut term_signal = tokio::signal::unix::signal(SignalKind::terminate())?;
36213621
let mut usr1_signal = tokio::signal::unix::signal(SignalKind::user_defined1())?;
36223622

3623-
let first_cleanup = tokio::time::Instant::now() + Duration::from_secs(60 * 60); /* 1h */
3624-
let mut cleanup_interval =
3625-
tokio::time::interval_at(first_cleanup, Duration::from_secs(24 * 60 * 60)); /* every 24h */
3623+
let first_cleanup = tokio::time::Instant::now() + Duration::from_hours(1);
3624+
let mut cleanup_interval = tokio::time::interval_at(first_cleanup, Duration::from_hours(24));
36263625

36273626
let appstate = AppState {
36283627
database,

src/task_cleanup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ async fn cleanup_mirror_deb_files(
522522
* For example if `apt update` was run un-proxied.
523523
*/
524524
if let Some(data) = &data {
525-
const KEEP_SPAN: Duration = Duration::from_secs(3 * 24 * 60 * 60); // 3 days
525+
const KEEP_SPAN: Duration = Duration::from_hours(3 * 24); // 3 days
526526

527527
let created = match data.created() {
528528
Ok(d) => d,

0 commit comments

Comments
 (0)