mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
Remove pointless Vec
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
parent
7dd852d7b7
commit
f9c2321ba1
1 changed files with 9 additions and 13 deletions
|
@ -34,26 +34,22 @@ pub(crate) fn create_pages(
|
|||
|
||||
packet.extend(comments_len.to_le_bytes().iter());
|
||||
|
||||
let mut comment_str = Vec::new();
|
||||
|
||||
for (a, b) in comments {
|
||||
comment_str.push(format!("{}={}", a, b));
|
||||
let last = comment_str.last().unwrap();
|
||||
let len = last.as_bytes().len() as u32;
|
||||
packet.extend(len.to_le_bytes().iter());
|
||||
packet.extend(last.as_bytes().iter());
|
||||
let comment = format!("{}={}", a, b);
|
||||
let comment_b = comment.as_bytes();
|
||||
packet.extend((comment_b.len() as u32).to_le_bytes().iter());
|
||||
packet.extend(comment_b.iter());
|
||||
}
|
||||
|
||||
if let Some(pics) = pictures {
|
||||
for pic in pics.iter() {
|
||||
comment_str.push(format!(
|
||||
let comment = format!(
|
||||
"METADATA_BLOCK_PICTURE={}",
|
||||
base64::encode(pic.as_apic_bytes())
|
||||
));
|
||||
let last = comment_str.last().unwrap();
|
||||
let len = last.as_bytes().len() as u32;
|
||||
packet.extend(len.to_le_bytes().iter());
|
||||
packet.extend(last.as_bytes().iter());
|
||||
);
|
||||
let comment_b = comment.as_bytes();
|
||||
packet.extend((comment_b.len() as u32).to_le_bytes().iter());
|
||||
packet.extend(comment_b.iter());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue