diff --git a/xmpp-parsers/src/caps.rs b/xmpp-parsers/src/caps.rs index 2b5e2fb0..24f129a2 100644 --- a/xmpp-parsers/src/caps.rs +++ b/xmpp-parsers/src/caps.rs @@ -158,9 +158,7 @@ pub fn compute_disco(disco: &DiscoInfoResult) -> Vec { } fn get_hash_vec(hash: &[u8]) -> Vec { - 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