Err(_) => 42,
};
- // int case, suggestion must surround Result expr with parenthesis
+ // int case, suggestion must surround Result expr with parentheses
match Ok(1) as Result<i32, &str> {
Ok(i) => i,
Err(_) => 42,
};
- // method call case, suggestion must not surround Result expr `s.method()` with parenthesis
- struct S {}
+ // method call case, suggestion must not surround Result expr `s.method()` with parentheses
+ struct S;
impl S {
fn method(self) -> Option<i32> {
Some(42)
}
}
+fn implicit_deref_ref() {
+ let _: &str = match Some(&"bye") {
+ None => "hi",
+ Some(s) => s,
+ };
+}
+
fn main() {}