I’m new to rust, and I’m not sure if the following is valid syntax or not:
|(a, b)| a < b
Is it possible to destructure inside of a closure parameter like this? If not, why does the compiler give such an unhelpful error message?
| 14 | let (roman, arabic) = *CONVERSIONS.iter().find(|(x, y)| n >= y).unwrap(); | ^^^^^^ expected reference, found tuple | = note: expected type `&&(&str, u16)` = note: found type `(_, _)`
I’ve tried it with (multiple)
* in front, but to no avail.