Skip to content

Commit 1d45f05

Browse files
review feedback, use an 'if cfg' construct instead
1 parent 5c2d615 commit 1d45f05

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

gix-features/tests/hash.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ fn size_of_sha1() {
66
assert_eq!(std::mem::size_of::<Sha1>(), 96)
77
}
88

9-
#[cfg(all(feature = "fast-sha1", target_arch = "x86"))]
9+
#[cfg(feature = "fast-sha1")]
1010
#[test]
1111
fn size_of_sha1() {
12-
assert_eq!(std::mem::size_of::<Sha1>(), 96)
13-
}
14-
15-
#[cfg(all(feature = "fast-sha1", not(target_arch = "x86")))]
16-
#[test]
17-
fn size_of_sha1() {
18-
assert_eq!(std::mem::size_of::<Sha1>(), 104)
12+
assert_eq!(std::mem::size_of::<Sha1>(), if cfg!(target_arch = "x86") { 96 } else { 104 })
1913
}

0 commit comments

Comments
 (0)