Skip to content

Commit f6f8f51

Browse files
fix one more error related to checksum checking
Signed-off-by: NikitaSkrynnik <[email protected]>
1 parent 9412ae2 commit f6f8f51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src-tauri/src/cef/utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ pub fn find_available_port() -> Result<u16, String> {
6565
}
6666

6767
pub fn compare_checksums(url: &str, checksum_path: impl AsRef<Path>) -> Result<bool, String> {
68-
let existing = fs::read_to_string(checksum_path)
69-
.map_err(|e| format!("failed to read existing checksum: {e}"))?;
68+
let Ok(existing) = fs::read_to_string(checksum_path) else {
69+
return Ok(false);
70+
};
7071
let new = download_checksum(url)?;
7172

7273
Ok(existing == new)
@@ -76,7 +77,7 @@ pub fn download_checksum(url: &str) -> Result<String, String> {
7677
let checksum = reqwest::blocking::get(format!("{url}.sha256"))
7778
.map_err(|e| format!("failed to download checksum: {e}"))?
7879
.text()
79-
.map_err(|e| format!("failed to read checksum response: {e}"))?;
80+
.map_err(|e| format!("failed to download checksum: {e}"))?;
8081
Ok(checksum)
8182
}
8283

0 commit comments

Comments
 (0)