-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
It would be useful to be able to compare Option<T>
with Option<U>
if T
and U
are comparable themselves. I.e.
impl<A, B> PartialEq<Option<B>> for Option<A> where A: PartialEq<B> { ... }
assert!(Some(String::from_str("str")) == Some("str"))
Heterogeneous comparisons for Option
are clear and unambiguous and there are precedents - some other basic library types, like Vec
or [T]
support heterogeneous comparisons too.
cc @aturon
cc rust-lang/rust#22838
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.