about summary refs log tree commit diff
path: root/users/tazjin/predlozhnik/src
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-07-28T18·42+0300
committertazjin <tazjin@tvl.su>2022-07-28T18·47+0000
commitcaf068253a8e7eacff0b255de66f830e726d6777 (patch)
treee995c5a9fb04e050a0d21298ffb47c659528fd21 /users/tazjin/predlozhnik/src
parent1a5e62c0763859c30dd5c5a641b1485d8ae9a664 (diff)
feat(predlozhnik): allow useful switches with active selection r/4341
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 <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/predlozhnik/src')
-rw-r--r--users/tazjin/predlozhnik/src/main.rs4
1 files changed, 2 insertions, 2 deletions
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(объясни(пж, пл)),
         },