Skip to content

Commit 0a8b314

Browse files
client: Avoid string re-allocation
1 parent 25ade32 commit 0a8b314

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

client/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ pub const CONTENT_TYPE_ATTRIBUTE: &str = "xdg:content-type";
6161
pub trait AsAttributes {
6262
fn as_attributes(&self) -> HashMap<&str, &str>;
6363

64-
#[allow(clippy::type_complexity)]
6564
fn hash<'a>(
6665
&'a self,
6766
key: &Key,
6867
) -> Vec<(&'a str, std::result::Result<Mac, crate::crypto::Error>)> {
6968
self.as_attributes()
7069
.into_iter()
71-
.map(|(k, v)| (k, crate::file::AttributeValue::from(v).mac(key)))
70+
.map(|(k, v)| (k, crypto::compute_mac(v.as_bytes(), key)))
7271
.collect()
7372
}
7473
}

0 commit comments

Comments
 (0)