aboutsummaryrefslogtreecommitdiff
path: root/crates/cli/src/words.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-01-13 21:51:00 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-01-13 21:51:00 +0100
commit84bc13b4dd181d14a100d2d8a3716525c79cd25e (patch)
tree4386fda27048133cc433165a4e83fd0532732a63 /crates/cli/src/words.rs
parent3f11980b29cda6340c809aff0c0f1c34e9c3ce26 (diff)
downloadmihi-84bc13b4dd181d14a100d2d8a3716525c79cd25e.tar.gz
mihi-84bc13b4dd181d14a100d2d8a3716525c79cd25e.zip
Fix style issues coming from recent merge
I apparently merged the 'inflection' branch without checking the code style. This means that a lot of warnings are being raised by clippy and I'm unsure which commit did what. Since I'm lazy about this right now, let's bring all fixes in a single commit. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates/cli/src/words.rs')
-rw-r--r--crates/cli/src/words.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/cli/src/words.rs b/crates/cli/src/words.rs
index 23a3946..60609a9 100644
--- a/crates/cli/src/words.rs
+++ b/crates/cli/src/words.rs
@@ -57,8 +57,8 @@ static FLAGS_TEXT: &str = r#"# Write a JSON blob with the following allowed keys
// Show the help message.
fn help(msg: Option<&str>) {
- if msg.is_some() {
- println!("{}.\n", msg.unwrap());
+ if let Some(msg) = msg {
+ println!("{}.\n", msg);
}
println!("mihi words: Manage words.\n");
@@ -613,8 +613,8 @@ fn show_info(word: Word) -> Result<(), String> {
// TODO: to_human
match word.conjugation_id {
Some(id) => println!("Conjugation: {}", id),
- None => match word.declension_id {
- Some(did) => {
+ None => {
+ if let Some(did) = word.declension_id {
if did > 5 {
println!("Declension: {}", humanize_kind(&word.kind));
} else {
@@ -625,8 +625,7 @@ fn show_info(word: Word) -> Result<(), String> {
);
}
}
- None => {}
- },
+ }
};
// Show translation if available.