aboutsummaryrefslogtreecommitdiff
path: root/crates/cli/src/words.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-01-19 21:48:32 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-01-19 22:01:36 +0100
commite1e7a94d0c781fa3c8a3c82a74c671ee1e92af92 (patch)
tree656137442ca8a1b6d1daf3c11296fd403779c088 /crates/cli/src/words.rs
parent19d7c1eab58d9f02e41f831eda121ef587487858 (diff)
downloadmihi-e1e7a94d0c781fa3c8a3c82a74c671ee1e92af92.tar.gz
mihi-e1e7a94d0c781fa3c8a3c82a74c671ee1e92af92.zip
run: ask for alternatives as well
This commit also fixes the need to ask for a random gender when asking for adjectives. This is somewhat unrelated to the main subject, but untying this now was a bit too much of a hassle. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates/cli/src/words.rs')
-rw-r--r--crates/cli/src/words.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/cli/src/words.rs b/crates/cli/src/words.rs
index 181ea81..413d193 100644
--- a/crates/cli/src/words.rs
+++ b/crates/cli/src/words.rs
@@ -653,8 +653,8 @@ fn show_info(word: Word) -> Result<(), String> {
let alternatives = &related[RelationKind::Alternative as usize - 1];
match alternatives.len() {
0 => {}
- 1 => println!("Alternative: {}", joint_related_words(&alternatives)),
- _ => println!("Alternatives: {}", joint_related_words(&alternatives)),
+ 1 => println!("Alternative: {}", joint_related_words(alternatives)),
+ _ => println!("Alternatives: {}", joint_related_words(alternatives)),
}
let gendered = &related[RelationKind::Gendered as usize - 1];
let g = if matches!(word.gender, Gender::Masculine) {
@@ -664,8 +664,8 @@ fn show_info(word: Word) -> Result<(), String> {
};
match gendered.len() {
0 => {}
- 1 => println!("{g} alternative: {}", joint_related_words(&gendered)),
- _ => println!("{g} alternatives: {}", joint_related_words(&gendered)),
+ 1 => println!("{g} alternative: {}", joint_related_words(gendered)),
+ _ => println!("{g} alternatives: {}", joint_related_words(gendered)),
}
// Show translation if available.
@@ -826,8 +826,8 @@ mod tests {
format!(
"{}-{}-{}",
first,
- mihi::joint_related_words(&alternatives),
- mihi::joint_related_words(&gendered)
+ mihi::joint_related_words(alternatives),
+ mihi::joint_related_words(gendered)
)
}