Skip to content

Commit

Permalink
fix: use new version of deprecated fn (#1994)
Browse files Browse the repository at this point in the history
update: crate-hasher sha256 dep to 1.1
  • Loading branch information
Velfi authored Nov 17, 2022
1 parent c187e3d commit d99a0db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tools/crate-hasher/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/crate-hasher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ opt-level = 0
anyhow = "1.0"
clap = { version = "~3.1.18", features = ["derive"] }
ignore = "0.4"
sha256 = "1.0"
sha256 = "1.1"

[dev-dependencies]
flate2 = "1.0"
Expand Down
5 changes: 3 additions & 2 deletions tools/crate-hasher/src/file_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

use anyhow::{Context, Result};
use std::collections::BTreeSet;
use std::fmt::Write;
use std::fs::Metadata;
use std::path::Path;

use anyhow::{Context, Result};

#[derive(Debug, Default)]
pub struct FileList(BTreeSet<FileMetadata>);

Expand Down Expand Up @@ -64,7 +65,7 @@ impl FileList {
.to_str()
.expect("not using unusual file names in crate source")
.into(),
sha256: sha256::digest_file(&path).context("hash file")?,
sha256: sha256::try_digest(path).context("hash file")?,
});
}
}
Expand Down

0 comments on commit d99a0db

Please sign in to comment.