Skip to content

Commit

Permalink
Make equality assertions consistent
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening authored and wrenger committed Jun 4, 2024
1 parent ed3b3be commit fceeb67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ let my_byte_lsb = MyLsbByte::new()
.with_level(2)
.with_present(true);

// .- present
// | .- level
// | | .- system
// | | | .- kind
assert!(my_byte_lsb.0 == 0b1_10_0_1010);
// .- present
// | .- level
// | | .- system
// | | | .- kind
assert_eq!(my_byte_lsb.0, 0b1_10_0_1010);
```

The macro generates the reverse order when Msb (most significant bit) is specified:
Expand All @@ -307,11 +307,11 @@ let my_byte_msb = MyMsbByte::new()
.with_level(2)
.with_present(true);

// .- kind
// | .- system
// | | .- level
// | | | .- present
assert!(my_byte_msb.0 == 0b1010_0_10_1);
// .- kind
// | .- system
// | | .- level
// | | | .- present
assert_eq!(my_byte_msb.0, 0b1010_0_10_1);
```

## Custom Representation and Endianness
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn attrs() {

let full = Full::new().with_data(u64::MAX);
assert_eq!(full.data(), u64::MAX);
assert!(full == Full::new().with_data(u64::MAX));
assert_eq!(full, Full::new().with_data(u64::MAX));
}

#[test]
Expand Down

0 comments on commit fceeb67

Please sign in to comment.