diff --git a/src/system/time.rs b/src/system/time.rs index 0345bd852..a1de977e5 100644 --- a/src/system/time.rs +++ b/src/system/time.rs @@ -23,6 +23,8 @@ impl SystemTime { crate::cutils::cerr(unsafe { libc::clock_gettime(libc::CLOCK_BOOTTIME, spec.as_mut_ptr()) })?; + // SAFETY: The `libc::clock_gettime` will correctly initialize `spec`, + // otherwise it will return early with the `?` operator. let spec = unsafe { spec.assume_init() }; Ok(spec.into()) }