You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/helpers/checksum.rs
+8-3
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
use anyhow::anyhow;
1
2
use anyhow::Result;
2
3
use sha2::{Digest,Sha256};
3
4
use std::path::Path;
@@ -13,9 +14,13 @@ use std::{fs, io};
13
14
///
14
15
/// This function returns a `Result` that contains a `bool` indicating whether the checksum of the file at path 'a' matches the checksum saved in the file at path 'b'.
15
16
/// If there is an error opening or reading the files, the function returns `Err(error)`.
16
-
pubfnsha256cmp(a:&Path,b:&Path) -> Result<bool>{
17
-
let checksum = fs::read_to_string(b)?;
18
-
let checksum = checksum.split(' ').next().unwrap();
0 commit comments