Skip to content

Commit b21da82

Browse files
dvdskcuviper
andcommitted
sleep_until: add reason to allow(unused)
Co-authored-by: Josh Stone <[email protected]>
1 parent 8763ffa commit b21da82

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

library/std/src/sys/pal/unix/time.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,7 @@ impl Instant {
292292
Some(Instant { t: self.t.checked_sub_duration(other)? })
293293
}
294294

295-
// reason for allow(unused): this is needed by the `sleep_until` implementation
296-
// for some unix platforms not all.
297-
#[allow(unused)]
295+
#[allow(unused, reason = "needed by the `sleep_until` on some unix platforms")]
298296
pub(crate) fn into_timespec(self) -> Timespec {
299297
self.t
300298
}

library/std/src/time.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,7 @@ impl Instant {
409409
}
410410

411411
// used by platform specific `sleep_until` implementations.
412-
// reason for #[allow(unused)]: not every platform has a specific `sleep_until`.
413-
#[allow(unused)]
412+
#[allow(unused, reason = "not every platform has a specific `sleep_until`")]
414413
pub(crate) fn into_inner(self) -> time::Instant {
415414
self.0
416415
}

0 commit comments

Comments
 (0)