Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,16 @@ impl Picture {
self.description = description.map(Cow::from);
}

/// Returns the picture data
/// Returns the [`Picture`] data as borrowed bytes.
pub fn data(&self) -> &[u8] {
&self.data
}

/// Consumes a [`Picture`], returning the data as [`Vec`] without clones or allocation.
pub fn into_data(self) -> Vec<u8> {
self.data.into_owned()
}

/// Convert a [`Picture`] to a ID3v2 A/PIC byte Vec
///
/// NOTE: This does not include the frame header
Expand Down