xmpp-parsers/caps: Simplify get_hash_vec().

Emmanuel Gil Peyrot created

Change summary

xmpp-parsers/src/caps.rs | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Detailed changes

xmpp-parsers/src/caps.rs 🔗

@@ -158,9 +158,7 @@ pub fn compute_disco(disco: &DiscoInfoResult) -> Vec<u8> {
 }
 
 fn get_hash_vec(hash: &[u8]) -> Vec<u8> {
-    let mut vec = Vec::with_capacity(hash.len());
-    vec.extend_from_slice(hash);
-    vec
+    hash.to_vec()
 }
 
 /// Hashes the result of [compute_disco()] with one of the supported [hash