From 2c7980b773cad586af5db8ff0755f1d74d94f7d1 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 14 Oct 2024 18:05:33 +0200 Subject: refactor(treewide): Conform to the clippy and rust lints --- crates/yt_dlp/src/duration.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/yt_dlp/src/duration.rs') diff --git a/crates/yt_dlp/src/duration.rs b/crates/yt_dlp/src/duration.rs index cd7454b..f91892d 100644 --- a/crates/yt_dlp/src/duration.rs +++ b/crates/yt_dlp/src/duration.rs @@ -9,6 +9,8 @@ // If not, see . // TODO: This file should be de-duplicated with the same file in the 'yt' crate <2024-06-25> + +#[derive(Debug, Clone, Copy)] pub struct Duration { time: u32, } @@ -26,6 +28,11 @@ impl From<&str> for Duration { impl From> for Duration { fn from(value: Option) -> Self { Self { + #[allow( + clippy::cast_possible_truncation, + clippy::cast_precision_loss, + clippy::cast_sign_loss + )] time: value.unwrap_or(0.0).ceil() as u32, } } -- cgit 1.4.1