mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-14 06:32:33 +00:00
id3v2: Retain frames by predicate
This commit is contained in:
parent
a769297545
commit
cff5d8fc6b
1 changed files with 8 additions and 0 deletions
|
@ -190,6 +190,14 @@ impl ID3v2Tag {
|
|||
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`]
|
||||
///
|
||||
/// According to spec, there can only be one picture of type [`PictureType::Icon`] and [`PictureType::OtherIcon`].
|
||||
|
|
Loading…
Reference in a new issue