You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use tuples-are-matchers support to specialize verify_eq on tuples.
This adds special cases in `verify_eq!` so that, when doing `eq` matching on sequences of tuple elements, the matcher applies tuple matching, distributing `eq` pointwise.
This improves the ergonomics of tests that check for tuple contents, such as:
```rust
let hash_map: std::collections::HashMap<String, String> =
std::collections::HashMap::from([
("a".into(), "A".into()),
("b".into(), "B".into())]);
verify_eq!(hash_map, {("a", "A"), ("b", "B")})
```
because the matcher for `&str` is compatible with `&String`.
The specialization applies on the inner structure; without it, the general matcher on tuples doesn't apply in the above case due to the definition of `PartialEq` on whole tuples, which is currently limited by rust-lang/rust#105092.
PiperOrigin-RevId: 695528259
0 commit comments