id3v2: Retain frames by predicate

This commit is contained in:
Uwe Klotz 2023-01-15 11:44:25 +01:00 committed by Alex
parent a769297545
commit cff5d8fc6b

View file

@ -190,6 +190,14 @@ impl ID3v2Tag {
self.frames.retain(|f| f.id_str() != id) self.frames.retain(|f| f.id_str() != id)
} }
/// Retains [`Frame`]s by evaluating the predicate
pub fn retain<P>(&mut self, predicate: P)
where
P: FnMut(&Frame<'_>) -> bool,
{
self.frames.retain(predicate)
}
/// Inserts a [`Picture`] /// Inserts a [`Picture`]
/// ///
/// According to spec, there can only be one picture of type [`PictureType::Icon`] and [`PictureType::OtherIcon`]. /// According to spec, there can only be one picture of type [`PictureType::Icon`] and [`PictureType::OtherIcon`].