message: Test and simplify Hash::into_array
diff: @@ -21,9 +21,7 @@ impl Hash {
  }
  pub(crate) fn into_array(self) -> [u8; 32] {
  - let mut total = [0u8; 32];
  - total[0..32].copy_from_slice(&self.0);
  - total
  + self.0
  }
  }
  @@ -56,3 +54,19 @@ impl FromStr for Hash {
  })?))
  }
  }
  +
  +#[cfg(test)]
  +mod tests {
  + use super::*;
  +
  + #[test]
  + fn hash_into_array_works() {
  + let original = [
  + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x12, 0x65, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
  + 0x12, 0x65, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x12, 0x65, 0xAA, 0xBB, 0xCC, 0xDD,
  + 0xEE, 0xFF, 0x12, 0x65,
  + ];
  + let hash = Hash::new(original);
  + assert_eq!(hash.into_array(), original);
  + }
  +}
  