print!("> ");
let mut line = String::new();
io::stdin().read_line(&mut line).expect("Failed to read line.\n");
match line {
_end => {
println!("\nThanks for using {}!", lambda);
process::exit(0);
},
_ => {
println!("{}", line);
},
}
}
why does it tell me that _end matches every string?
pattern must be known at compile-time. since there's no constant named _end, the compile figures out that it is a catch-all binding
I think you want something like s if s == "end"
Обсуждают сегодня