I'm trying hard to get on board with Rust syntax and learning when I need to explicitly specify that I want to pass a reference. But needing to do that on a literal number seems really strange!
fn main() {
let range = 3..7;
println!("{}", range.contains(&5)); // Why can't the compiler handle passing just 5?
}
Output:
true
Errors:
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 0.56s
Running `target/debug/playground`