Skip to content

Commit 9aea929

Browse files
authored
time: update comment in zero_init_timespec (#2730)
1 parent b44fd1a commit 9aea929

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/sys/time.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ use std::time::Duration;
99
use std::{cmp, fmt, ops};
1010

1111
const fn zero_init_timespec() -> timespec {
12-
// `std::mem::MaybeUninit::zeroed()` is not yet a const fn
13-
// (https://github.com/rust-lang/rust/issues/91850) so we will instead initialize an array of
14-
// the appropriate size to zero and then transmute it to a timespec value.
12+
// TODO(MSRV>=1.75, feature(const_maybe_uninit_zeroed): use [`std::mem::MaybeUninit::zeroed()`]
1513
unsafe { std::mem::transmute([0u8; std::mem::size_of::<timespec>()]) }
1614
}
1715

0 commit comments

Comments
 (0)