summaryrefslogtreecommitdiffstats
path: root/vendor/gix-object/src/data.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-object/src/data.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-object/src/data.rs')
-rw-r--r--vendor/gix-object/src/data.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/gix-object/src/data.rs b/vendor/gix-object/src/data.rs
index e66360357..cea807684 100644
--- a/vendor/gix-object/src/data.rs
+++ b/vendor/gix-object/src/data.rs
@@ -67,8 +67,7 @@ pub mod verify {
/// Compute the checksum of `self` and compare it with the `desired` hash.
/// If the hashes do not match, an [`Error`] is returned, containing the actual
/// hash of `self`.
- pub fn verify_checksum(&self, desired: impl AsRef<gix_hash::oid>) -> Result<(), Error> {
- let desired = desired.as_ref();
+ pub fn verify_checksum(&self, desired: &gix_hash::oid) -> Result<(), Error> {
let actual_id = crate::compute_hash(desired.kind(), self.kind, self.data);
if desired != actual_id {
return Err(Error::ChecksumMismatch {
@@ -87,6 +86,9 @@ mod tests {
#[test]
fn size_of_object() {
+ #[cfg(target_pointer_width = "64")]
assert_eq!(std::mem::size_of::<Data<'_>>(), 24, "this shouldn't change unnoticed");
+ #[cfg(target_pointer_width = "32")]
+ assert_eq!(std::mem::size_of::<Data<'_>>(), 12, "this shouldn't change unnoticed");
}
}