History

Impl == and != for common combinations of ObjectId/oid (#63)

Sebastian Thiel committed 5 years ago

Commit 24551781 parent 59ab1bd5 files · +20 −8Browse files

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

Unified · Split

git-commitgraph/src/file/verify.rs+2−2
@@ -154,7 +154,7 @@ impl File { · 153 unmodified lines
154154 let actual = git_hash::ObjectId::new_sha1(hasher.digest());
155155
156156 let expected = self.checksum();
157− if actual.as_ref() == expected {
157+ if actual == expected {
158158 Ok(actual)
159159 } else {
160160 Err((actual, expected.into()))
@@ -171,7 +171,7 @@ fn verify_split_chain_filename_hash(path: impl AsRef<Path>, expected: &git_hash: · 10 unmodified lines
171171 .and_then(|filename| filename.strip_suffix(".graph"))
172172 .and_then(|stem| stem.strip_prefix("graph-"))
173173 .map_or(Ok(()), |hex| match git_hash::ObjectId::from_hex(hex.as_bytes()) {
174− Ok(actual) if actual.as_ref() == expected => Ok(()),
174+ Ok(actual) if actual == expected => Ok(()),
175175 _ => Err(format!("graph-{}.graph", expected.to_sha1_hex().as_bstr())),
176176 })
177177 }