-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
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
Currently, only the case where T == U
is covered. Presumably this is because of derive limitations, since this impl is indeed derived in libcore.
I believe it should be possible and correct to provide the following impl:
impl<T, U> PartialEq<Option<U>> for Option<T> where T: PartialEq<U>, U: PartialEq<T> {
fn eq(&self, rhs: &Option<U>) -> bool {
match (self, rhs) {
(&Some(ref lhs), &Some(ref rhs)) if lhs == rhs => true,
(&None, &None) => true,
_ => false
}
}
}
Techcable, Lucretiel, timvermeulen, vultix, farmaazon and 1 more
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.