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)
    }
}

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]);
            }
        },
    }
}

--- 
+++ 
@@ -1,19 +1,11 @@
 use std::env;
 
-#[allow(while_true)]
 fn main() {
     let args: Vec<String> = env::args().collect();
+    let args = &args[1..];
 
-    match args.len() {
-        1 => {
-            while true {
-                println!("y");
-            }
-        },
-        _ => {
-            while true {
-                println!("{}", args[1]);
-            }
-        },
+    let output = if args.is_empty() { "y".to_string() } else { args.join(" ") };
+    loop {
+        println!("{}", output)
     }
 }
Rust: Simplify solution, use `loop` for endless loop
