about summary refs log tree commit diff stats
path: root/crates/yt_dlp/src/duration.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/yt_dlp/src/duration.rs')
-rw-r--r--crates/yt_dlp/src/duration.rs7
1 files changed, 7 insertions, 0 deletions
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 <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 // 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<Option<f64>> for Duration {
     fn from(value: Option<f64>) -> Self {
         Self {
+            #[allow(
+                clippy::cast_possible_truncation,
+                clippy::cast_precision_loss,
+                clippy::cast_sign_loss
+            )]
             time: value.unwrap_or(0.0).ceil() as u32,
         }
     }