From a123afd052f1ed81b3744dd76989bd836a4ed537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Thu, 2 Oct 2025 12:57:00 +0200 Subject: [PATCH] Simplify formatting. --- src/worker.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/worker.rs b/src/worker.rs index 6dd1d5a..1aa97c7 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -67,7 +67,7 @@ pub fn work(in_path:Option<&str>, out_path:Option<&str>) -> Result<(), String> match ch { '[' | '{' => { tab_num += 1; - out_writer.write(format!("{}\n", ch).as_bytes()).unwrap(); + out_writer.write(format!("{ch}\n").as_bytes()).unwrap(); for _ in 0..tab_num { out_writer.write(b" ").unwrap(); } @@ -79,11 +79,11 @@ pub fn work(in_path:Option<&str>, out_path:Option<&str>) -> Result<(), String> for _ in 0..tab_num { out_writer.write(b" ").unwrap(); } - out_writer.write(format!("{}", ch).as_bytes()).unwrap(); + out_writer.write(format!("{ch}").as_bytes()).unwrap(); last_ch = ch; }, ',' => { - out_writer.write(format!("{}", ch).as_bytes()).unwrap(); + out_writer.write(format!("{ch}").as_bytes()).unwrap(); if last_ch == '}' || last_ch == ']' { out_writer.write(b"\n").unwrap(); for _ in 0..tab_num { @@ -96,7 +96,7 @@ pub fn work(in_path:Option<&str>, out_path:Option<&str>) -> Result<(), String> }, _ => { if ch != ' ' || last_ch != ' ' { - out_writer.write(format!("{}", ch).as_bytes()).unwrap(); + out_writer.write(format!("{ch}").as_bytes()).unwrap(); last_ch = ch; } },