From 9a2cacf024577251f068e53bae86c6752a264458 Mon Sep 17 00:00:00 2001 From: Luro02 <24826124+Luro02@users.noreply.github.com> Date: Sat, 28 Mar 2020 10:48:17 +0100 Subject: [PATCH] fix some clippy lints --- src/media_playlist.rs | 1 + src/types/key_format_versions.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/media_playlist.rs b/src/media_playlist.rs index 3c2a06e..855aea8 100644 --- a/src/media_playlist.rs +++ b/src/media_playlist.rs @@ -383,6 +383,7 @@ impl MediaPlaylist { /// Computes the `Duration` of the [`MediaPlaylist`], by adding each segment /// duration together. + #[must_use] pub fn duration(&self) -> Duration { self.segments.values().map(|s| s.duration.duration()).sum() } diff --git a/src/types/key_format_versions.rs b/src/types/key_format_versions.rs index 494f4ac..601fdf6 100644 --- a/src/types/key_format_versions.rs +++ b/src/types/key_format_versions.rs @@ -184,7 +184,7 @@ impl KeyFormatVersions { /// ``` #[inline] #[must_use] - pub fn is_empty(&self) -> bool { self.len() == 0 } + pub const fn is_empty(&self) -> bool { self.len() == 0 } /// Removes the last element and returns it, or `None` if it is empty. ///