Skip to content

Commit d99a0db

Browse files
author
Zelda Hessler
authored
fix: use new version of deprecated fn (#1994)
update: crate-hasher sha256 dep to 1.1
1 parent c187e3d commit d99a0db

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

tools/crate-hasher/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/crate-hasher/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ opt-level = 0
1717
anyhow = "1.0"
1818
clap = { version = "~3.1.18", features = ["derive"] }
1919
ignore = "0.4"
20-
sha256 = "1.0"
20+
sha256 = "1.1"
2121

2222
[dev-dependencies]
2323
flate2 = "1.0"

tools/crate-hasher/src/file_list.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
use anyhow::{Context, Result};
76
use std::collections::BTreeSet;
87
use std::fmt::Write;
98
use std::fs::Metadata;
109
use std::path::Path;
1110

11+
use anyhow::{Context, Result};
12+
1213
#[derive(Debug, Default)]
1314
pub struct FileList(BTreeSet<FileMetadata>);
1415

@@ -64,7 +65,7 @@ impl FileList {
6465
.to_str()
6566
.expect("not using unusual file names in crate source")
6667
.into(),
67-
sha256: sha256::digest_file(&path).context("hash file")?,
68+
sha256: sha256::try_digest(path).context("hash file")?,
6869
});
6970
}
7071
}

0 commit comments

Comments
 (0)