src/main.rs aktualisiert

This commit is contained in:
robin 2024-08-08 15:33:20 +02:00
parent 7b47cdc1a6
commit 147add5654

View file

@ -22,7 +22,7 @@ fn start() {
println!("Hello what is your Name?"); println!("Hello what is your Name?");
let mut name = String::new(); let mut name = String::new();
io::stdin().read_line(&mut name).expect("error"); io::stdin().read_line(&mut name).expect("error");
if name.is_empty() == true{ if name.trim.is_empty() == true{
invalid_input(3) invalid_input(3)
}else { }else {
println!("Hello {}", name); println!("Hello {}", name);