diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-14 18:05:33 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-14 18:05:33 +0200 |
commit | 2c7980b773cad586af5db8ff0755f1d74d94f7d1 (patch) | |
tree | 5207aa3a69945ae7d5e5ef77ad14a50313954c25 /crates/yt_dlp/src/duration.rs | |
parent | feat(unreachable): Init trait (diff) | |
download | yt-2c7980b773cad586af5db8ff0755f1d74d94f7d1.tar.gz yt-2c7980b773cad586af5db8ff0755f1d74d94f7d1.zip |
refactor(treewide): Conform to the clippy and rust lints
Diffstat (limited to 'crates/yt_dlp/src/duration.rs')
-rw-r--r-- | crates/yt_dlp/src/duration.rs | 7 |
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, } } |