From caf068253a8e7eacff0b255de66f830e726d6777 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 28 Jul 2022 21:42:28 +0300 Subject: feat(predlozhnik): allow useful switches with active selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this lets users switch between all compatible prepositions and cases for the currently selected combination, which makes the UI a bit easier to explore. Спасибо /u/wrest3! Change-Id: Iaf4e90403c90beb5d75acfa73fd0f5f2cb5035c5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5996 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/predlozhnik/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'users/tazjin') diff --git a/users/tazjin/predlozhnik/src/main.rs b/users/tazjin/predlozhnik/src/main.rs index 7e036f436430..74677129e768 100644 --- a/users/tazjin/predlozhnik/src/main.rs +++ b/users/tazjin/predlozhnik/src/main.rs @@ -152,8 +152,8 @@ fn объясни(падеж: Падеж, предлог: &str) -> Html { fn ограничить(м: &Модель) -> Вывод { match (м.падеж, &м.предлог) { (Some(пж), Some(пл)) => Вывод { - доступные_падежи: BTreeSet::from([пж]), - доступные_предлоги: BTreeSet::from([*пл]), + доступные_падежи: (*ПО_ПРЕДЛОГУ)[пл].clone(), + доступные_предлоги: (*ПО_ПАДЕЖУ)[&пж].clone(), объяснение: Some(объясни(пж, пл)), }, -- cgit 1.4.1