I've tried the naive approach
fn main() -> Result<(), Box<std::error::Error>> {
let num = 0;
match num {
u64::max_value() => println!("Is u64::max_value()"),
_ => println!("Is boring")
}
Ok(())
}
but it fails with expected tuple struct/variant, found method <u64>::max_value
.
Is there another syntax except n if n == u64::max_value() => ...
which can I use?