History

use latest capabilities of `git-hash` (#279)

Sebastian Thiel committed 4 years ago

Commit a489ac21 parent 84e26a71 file · +1 −6Browse files

Showing the changes to git-commitgraph/src (1 of 1 file). Show all

Unified · Split

git-commitgraph/src/file/init.rs+1−6
@@ -92,12 +92,7 @@ impl TryFrom<&Path> for File { · 91 unmodified lines
9292 };
9393 ofs += 1;
9494
95− let object_hash = match data[ofs] {
96− 1 => git_hash::Kind::Sha1,
97− x => {
98− return Err(Error::UnsupportedHashVersion(x));
99− }
100− };
95+ let object_hash = git_hash::Kind::try_from(data[ofs]).map_err(|x| Error::UnsupportedHashVersion(x))?;
10196 ofs += 1;
10297
10398 let chunk_count = data[ofs];