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,11 +1,19 @@
 use std::env;
 
+#[allow(while_true)]
 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)
+    match args.len() {
+        1 => {
+            while true {
+                println!("y");
+            }
+        },
+        _ => {
+            while true {
+                println!("{}", args[1]);
+            }
+        },
     }
 }
Rust: Simplify solution, use `loop` for endless loop
