ecaps2: Avoid a useless clone.

Emmanuel Gil Peyrot created

Change summary

src/ecaps2.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

src/ecaps2.rs 🔗

@@ -120,7 +120,6 @@ pub fn compute_disco(disco: &Disco) -> Vec<u8> {
 
 pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result<Hash, String> {
     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<Hash, String> {
             Algo::Sha_1 => return Err(String::from("Disabled algorithm sha-1: unsafe.")),
             Algo::Unknown(algo) => return Err(format!("Unknown algorithm: {}.", algo)),
         },
+        algo: algo,
     })
 }