From e1e7a94d0c781fa3c8a3c82a74c671ee1e92af92 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 19 Jan 2026 21:48:32 +0100 Subject: run: ask for alternatives as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- crates/cli/src/words.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/cli/src/words.rs') 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) ) } -- cgit v1.2.3