In Rust github issues/62358, I found someone suggest to implement the following method
pub fn contains(&self, x: &T) -> bool where T: PartialEq {
match self {
Some(y) => y == x,
None => false,
}
}
pub fn contains(&self, x: &T) -> bool where T: PartialEq {
match self {
Ok(y) => y == x,
Err(_) => false,
}
}
but the member of the language suggest
Should we update the signatures to
fn contains<U>(&self, x: &U) -> bool where T: PartialEq<U>?
Can any one explain me what is the different between those two function signatures?
With regards.