Skip to content

Commit

Permalink
Remove unnecessary parens from core and alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 17, 2025
1 parent d39ec6d commit a791362
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions library/alloc/tests/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2297,21 +2297,21 @@ fn utf8_chars() {
assert_eq!(schs.len(), 4);
assert_eq!(schs.iter().cloned().collect::<String>(), s);

assert!((from_utf8(s.as_bytes()).is_ok()));
assert!(from_utf8(s.as_bytes()).is_ok());
// invalid prefix
assert!((!from_utf8(&[0x80]).is_ok()));
assert!(!from_utf8(&[0x80]).is_ok());
// invalid 2 byte prefix
assert!((!from_utf8(&[0xc0]).is_ok()));
assert!((!from_utf8(&[0xc0, 0x10]).is_ok()));
assert!(!from_utf8(&[0xc0]).is_ok());
assert!(!from_utf8(&[0xc0, 0x10]).is_ok());
// invalid 3 byte prefix
assert!((!from_utf8(&[0xe0]).is_ok()));
assert!((!from_utf8(&[0xe0, 0x10]).is_ok()));
assert!((!from_utf8(&[0xe0, 0xff, 0x10]).is_ok()));
assert!(!from_utf8(&[0xe0]).is_ok());
assert!(!from_utf8(&[0xe0, 0x10]).is_ok());
assert!(!from_utf8(&[0xe0, 0xff, 0x10]).is_ok());
// invalid 4 byte prefix
assert!((!from_utf8(&[0xf0]).is_ok()));
assert!((!from_utf8(&[0xf0, 0x10]).is_ok()));
assert!((!from_utf8(&[0xf0, 0xff, 0x10]).is_ok()));
assert!((!from_utf8(&[0xf0, 0xff, 0xff, 0x10]).is_ok()));
assert!(!from_utf8(&[0xf0]).is_ok());
assert!(!from_utf8(&[0xf0, 0x10]).is_ok());
assert!(!from_utf8(&[0xf0, 0xff, 0x10]).is_ok());
assert!(!from_utf8(&[0xf0, 0xff, 0xff, 0x10]).is_ok());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion library/core/tests/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn test_partial_ord() {
assert!(!((1.0f64, 2.0f64) <= (f64::NAN, 3.0)));
assert!(!((1.0f64, 2.0f64) > (f64::NAN, 3.0)));
assert!(!((1.0f64, 2.0f64) >= (f64::NAN, 3.0)));
assert!(((1.0f64, 2.0f64) < (2.0, f64::NAN)));
assert!((1.0f64, 2.0f64) < (2.0, f64::NAN));
assert!(!((2.0f64, 2.0f64) < (2.0, f64::NAN)));
}

Expand Down

0 comments on commit a791362

Please sign in to comment.