Skip to content

Commit

Permalink
static_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Oct 3, 2023
1 parent 74061b4 commit de20137
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion blockset/src/sha224.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ mod tests {
}

const fn static_assert(v: bool) -> () {
[0][1 - v as usize];
[0][!v as usize];
}

const _: () = static_assert(eq(
Expand All @@ -180,10 +180,15 @@ mod tests {

#[test]
fn test() {
assert!(eq(
A,
[0xd14a028c, 0x2a3a2bc9, 0x476102bb, 0x288234c4, 0x15a2b01f, 0x828ea62a, 0xc5b3e42f]
));
assert_eq!(
A,
[0xd14a028c, 0x2a3a2bc9, 0x476102bb, 0x288234c4, 0x15a2b01f, 0x828ea62a, 0xc5b3e42f]
);
static_assert(true);
}

#[test]
Expand Down

0 comments on commit de20137

Please sign in to comment.