use std::env;

#[allow(while_true)]
fn main() {
    let args: Vec<String> = env::args().collect();

    match args.len() {
        1 => {
            while true {
                println!("y");
            }
        },
        _ => {
            while true {
                println!("{}", args[1]);
            }
        },
    }
}

use std::env;

fn main() {
    let args: Vec<String> = env::args().collect();
    let args = &args[1..];

    let output = if args.is_empty() { "y".to_string() } else { args.join(" ") };
    loop {
        println!("{}", output)
    }
}

Simplify solution, use `loop` for endless loop
Rust: Simplify solution, use `loop` for endless loop
