Skip to content

Commit

Permalink
review feedback, use an 'if cfg' construct instead
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkjall committed Nov 27, 2023
1 parent 5c2d615 commit 1d45f05
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions gix-features/tests/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ fn size_of_sha1() {
assert_eq!(std::mem::size_of::<Sha1>(), 96)
}

#[cfg(all(feature = "fast-sha1", target_arch = "x86"))]
#[cfg(feature = "fast-sha1")]
#[test]
fn size_of_sha1() {
assert_eq!(std::mem::size_of::<Sha1>(), 96)
}

#[cfg(all(feature = "fast-sha1", not(target_arch = "x86")))]
#[test]
fn size_of_sha1() {
assert_eq!(std::mem::size_of::<Sha1>(), 104)
assert_eq!(std::mem::size_of::<Sha1>(), if cfg!(target_arch = "x86") { 96 } else { 104 })
}

0 comments on commit 1d45f05

Please sign in to comment.