utils: Fix debug_assert for converting Time
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled

This commit is contained in:
Victoria Brekenfeld 2024-07-10 22:01:59 +02:00 committed by Victoria Brekenfeld
parent 4cc46d4f60
commit 8c5f965089

View file

@ -77,8 +77,8 @@ impl<Kind> Copy for Time<Kind> {}
impl<Kind: NonNegativeClockSource> From<Time<Kind>> for Duration {
#[inline]
fn from(time: Time<Kind>) -> Self {
debug_assert!(time.tp.tv_sec > 0);
debug_assert!(time.tp.tv_nsec > 0);
debug_assert!(time.tp.tv_sec >= 0);
debug_assert!(time.tp.tv_nsec >= 0);
Duration::new(time.tp.tv_sec as u64, time.tp.tv_nsec as u32)
}
}