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. ///