File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,9 @@ pub fn find_available_port() -> Result<u16, String> {
65
65
}
66
66
67
67
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
+ } ;
70
71
let new = download_checksum ( url) ?;
71
72
72
73
Ok ( existing == new)
@@ -76,7 +77,7 @@ pub fn download_checksum(url: &str) -> Result<String, String> {
76
77
let checksum = reqwest:: blocking:: get ( format ! ( "{url}.sha256" ) )
77
78
. map_err ( |e| format ! ( "failed to download checksum: {e}" ) ) ?
78
79
. text ( )
79
- . map_err ( |e| format ! ( "failed to read checksum response : {e}" ) ) ?;
80
+ . map_err ( |e| format ! ( "failed to download checksum: {e}" ) ) ?;
80
81
Ok ( checksum)
81
82
}
82
83
You can’t perform that action at this time.
0 commit comments