Closed
Description
Given the following code:
fn main() {
let a = Some(42);
println!(
"The value is {}.",
(a.unwrap)()
);
}
The current output is:
error[E0615]: attempted to take value of method `unwrap` on type `Option<{integer}>`
--> src/main.rs:5:12
|
5 | (a.unwrap)()
| ^^^^^^ method, not a field
|
help: use parentheses to call the method
|
5 | (a.unwrap)()()
| ++
Ideally the output should look like:
help: remove these parentheses
(a.unwrap)()
^^^^^^^^^^
But at least adding parentheses right next to the method name would be an improvement:
help: use parentheses to call the method
|
5 | (a.unwrap())()
| ++