Fix clippy error by replacing match with unwrap_or
@@ -42,10 +42,7 @@ pub fn hash(to_hash: &str, num: usize) -> String {
let mut sha = Sha512::new();
sha.input_str(to_hash);
let temp = sha.result_str();
- let hash = match temp.get(..num) {
- Some(x) => x,
- None => "",
- };
+ let hash = temp.get(..num).unwrap_or("");
hash.to_string()
}
