diff options
author | Joris | 2023-11-25 08:59:39 +0100 |
---|---|---|
committer | Joris | 2023-11-25 08:59:39 +0100 |
commit | bb906d8ecc796f6b71dda1851d6bd0aa91c6bce5 (patch) | |
tree | cf98c0d9466e0338992c94060d09ac90862178c5 /src/assets.rs | |
parent | 936871e6ba92a23b1956b30272af8c96951c7c2d (diff) |
Upgrade dependencies
Diffstat (limited to 'src/assets.rs')
-rw-r--r-- | src/assets.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/assets.rs b/src/assets.rs index 80f9630..36fab55 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -2,6 +2,7 @@ use sha2::{Digest, Sha256}; use std::collections::HashMap; use std::fs; use std::iter::FromIterator; +use std::fmt::Write; pub fn get() -> HashMap<String, String> { let paths = fs::read_dir("assets").unwrap().map(|e| { @@ -19,9 +20,10 @@ pub fn get() -> HashMap<String, String> { fn sha256(input: Vec<u8>) -> String { let mut hasher = Sha256::new(); hasher.update(input); - hasher - .finalize() - .iter() - .map(|b| format!("{:x}", b)) - .collect() + + let mut res = String::new(); + for byte in hasher.finalize().iter() { + write!(&mut res, "{:x}", byte).unwrap(); + } + res } |