Skip to content

Commit 433aaca

Browse files
A6GibKmbilelmoussaoui
authored andcommitted
client: file: item: Remove two clones
These turn a Vec into a slice into a Vec.
1 parent a212ebe commit 433aaca

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

client/src/file/item.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,13 @@ impl Item {
144144

145145
let decrypted = Zeroizing::new(zvariant::to_bytes(*GVARIANT_ENCODING, &self)?.to_vec());
146146

147-
let iv = crypto::generate_iv()?;
147+
let mut iv = crypto::generate_iv()?;
148148

149149
let mut blob = crypto::encrypt(&*decrypted, key, &iv)?;
150150

151-
blob.append(&mut iv.as_slice().into());
152-
blob.append(&mut crypto::compute_mac(&blob, key)?.as_slice().into());
151+
blob.append(&mut iv);
152+
let mut mac = crypto::compute_mac(&blob, key)?;
153+
blob.append(&mut mac);
153154

154155
let hashed_attributes = self
155156
.attributes

0 commit comments

Comments
 (0)