From f18043231c450c91cda41c37e38dbead8e228410 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 18 May 2017 23:12:45 +0100 Subject: [PATCH] ecaps2: Avoid a useless clone. --- src/ecaps2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ecaps2.rs b/src/ecaps2.rs index e397a45..b69a644 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -120,7 +120,6 @@ pub fn compute_disco(disco: &Disco) -> Vec { pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result { Ok(Hash { - algo: algo.clone(), hash: match algo { Algo::Sha_256 => { let mut hasher = Sha256::default(); @@ -163,6 +162,7 @@ pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result { Algo::Sha_1 => return Err(String::from("Disabled algorithm sha-1: unsafe.")), Algo::Unknown(algo) => return Err(format!("Unknown algorithm: {}.", algo)), }, + algo: algo, }) }