summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStrubbelkopp <[email protected]>2025-07-25 12:57:34 +0200
committerStrubbelkopp <[email protected]>2025-07-25 12:57:34 +0200
commit82e2ec3fbddbb67cec79505866fb8c2308eec429 (patch)
tree71b8e39491bde79dad09af572d8fb1725f6925e6 /src
parent7a3ed2ba020cc36b8dac59a07e9925e6d1a50710 (diff)
downloadmikusays-c-82e2ec3fbddbb67cec79505866fb8c2308eec429.tar.gz
mikusays-c-82e2ec3fbddbb67cec79505866fb8c2308eec429.zip
Use unwrap_or() instead of match block; remove unused import
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
1 files changed, 1 insertions, 5 deletions
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<dyn std::error::Error>> {
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(())