We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
into_data()
1 parent 1893308 commit 8a389c4Copy full SHA for 8a389c4
src/picture.rs
@@ -535,11 +535,16 @@ impl Picture {
535
self.description = description.map(Cow::from);
536
}
537
538
- /// Returns the picture data
+ /// Returns the [`Picture`] data as borrowed bytes.
539
pub fn data(&self) -> &[u8] {
540
&self.data
541
542
543
+ /// Consumes a [`Picture`], returning the data as [`Vec`] without clones or allocation.
544
+ pub fn into_data(self) -> Vec<u8> {
545
+ self.data.into_owned()
546
+ }
547
+
548
/// Convert a [`Picture`] to a ID3v2 A/PIC byte Vec
549
///
550
/// NOTE: This does not include the frame header
0 commit comments