From 82e2ec3fbddbb67cec79505866fb8c2308eec429 Mon Sep 17 00:00:00 2001 From: Strubbelkopp Date: Fri, 25 Jul 2025 12:57:34 +0200 Subject: Use unwrap_or() instead of match block; remove unused import --- src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 354b88c..657bcc1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ use clap::Parser; use crossterm::terminal::size; -use std::env; use unicode_width::UnicodeWidthStr; mod mikuart; @@ -21,10 +20,7 @@ fn main() -> Result<(), Box> { let args = Args::parse(); let text = args.text; - let style = match args.style { - Some(s) => s, - None => -1, // Default to -1 to select a random style - }; + let style = args.style.unwrap_or(-1); // Default to -1 to select a random style draw_miku_says(&text, style)?; Ok(()) -- cgit v1.3-2-g0d8e