HI, THIS PIECE GIVE ME ERROR: error[E0080]: runtime values cannot be referenced in patterns
0 ..= genre_vector_len => {
| ^^^^^^^^^^^^^^^^
// TESTS
use std::{fs, io};
use std::path::Path;
use std::str::FromStr;
fn main() -> io::Result<()> {
// .variables
let genre_vector = vec!["book1","book3","book2","book5"];
genre_vector.sort();
loop {
// .print list from genre_vector
for (i, gen) in genre_vector.iter().enumerate() {
println!("[{}] {} ", i, gen);
}
// .reading from keyboard
let mut input = String::new();
let stdin_preset = io::stdin();
stdin_preset.read_line(&mut input);
let genre_vector_len = genre_vector.len() as u32;
let input:u32 = input.trim().parse().expect("Please type a number!");
match input {
0 ..= genre_vector_len => { // error[E0080]: runtime values cannot be referenced in patterns
println!("Correct Input!");
break;
},
_ => println!("Incorrect. Choice 0-{}", genre_vector_len),
} // end m1
} // end loop
Ok(())
}