this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: fix clippy issues

+9 -12
+7 -10
crates/tala-cli/src/main.rs
··· 75 75 for p in paths { 76 76 if p.is_dir() { 77 77 out.extend(find_typ_files(&p)); 78 - } else if p.extension().map_or(false, |e| e == "typ") { 78 + } else if p.extension().is_some_and(|e| e == "typ") { 79 79 // Skip sidecar-style .srs.json files that happen to end in .typ (shouldn't exist). 80 80 out.push(p); 81 81 } ··· 141 141 for (fi, df) in files.iter().enumerate() { 142 142 for (ci, card) in df.cards.iter().enumerate() { 143 143 let card_id = ci.to_string(); 144 - if let Some(tag) = tag_filter { 145 - if !card.tags.iter().any(|t| t == tag) { 146 - continue; 147 - } 144 + if let Some(tag) = tag_filter && !card.tags.iter().any(|t| t == tag) { 145 + continue; 148 146 } 149 147 match (&card.kind, df.sidecar.get(&card_id)) { 150 148 (CardKind::FrontBack { .. }, sched) => { ··· 152 150 Some(CardSchedule::FrontBack { forward_schedule, .. }) => forward_schedule.clone(), 153 151 _ => None, 154 152 }; 155 - if fwd.as_ref().map_or(true, is_due) { 153 + if fwd.as_ref().is_none_or(is_due) { 156 154 queue.push(Item { file_idx: fi, card_id: card_id.clone(), 157 155 kind: card.kind.clone(), sub_id: "forward".into(), current: fwd }); 158 156 } ··· 166 164 for blank in blanks { 167 165 let key = format!("b{}", blank.index); 168 166 let current = blank_schedules.get(&key).cloned(); 169 - if current.as_ref().map_or(true, is_due) { 167 + if current.as_ref().is_none_or(is_due) { 170 168 queue.push(Item { file_idx: fi, card_id: card_id.clone(), 171 169 kind: card.kind.clone(), sub_id: key, current }); 172 170 } ··· 247 245 CardKind::FrontBack { .. } => { 248 246 let entry = sidecar.cards.entry(card_id.to_owned()) 249 247 .or_insert(CardSchedule::FrontBack { forward_schedule: None, reverse_schedule: None }); 250 - if let CardSchedule::FrontBack { forward_schedule, .. } = entry { 251 - if sub_id == "forward" { *forward_schedule = Some(sched); } 252 - } 248 + if let CardSchedule::FrontBack { forward_schedule, .. } = entry 249 + && sub_id == "forward" { *forward_schedule = Some(sched); } 253 250 } 254 251 CardKind::Cloze { .. } => { 255 252 let entry = sidecar.cards.entry(card_id.to_owned())
+2 -2
crates/tala/src/main.rs
··· 509 509 } 510 510 }, 511 511 oninput: on_input, 512 - onkeydown: on_keydown.clone(), 512 + onkeydown: on_keydown, 513 513 } 514 514 } else { 515 515 pre { class: "text-seg-preview", "{preview_text}" } ··· 593 593 } 594 594 }, 595 595 oninput: on_input, 596 - onkeydown: on_keydown.clone(), 596 + onkeydown: on_keydown, 597 597 } 598 598 } 599 599 // ── Preview ───────────────────────────────────