Temporal todo

This commit is contained in:
micialware committed 2026-08-31 14:50:21 +03:00
1 parent 55bdc5a7ad
commit 1509947cb0
3 files changed
+74 -69

No files matched your search

+25 -24
View File
@@ -25,30 +25,31 @@ impl DeckData {
settings: &DeckSettings,
state: AppState,
) -> Result<Self, NotificationData> {
let state_for = state.clone();
let stats = state (settings, &state.connection.read())?;
let words = stats
.iter()
.map(|stat| {
state
.dictionary
.binary_search_by_key(&stat.word_id, |w| w.id)
.expect("No word found in dictionary")
})
.map(|index| &state.dictionary[index])
.cloned()
.collect();
Ok(Self {
set: stats,
words,
current_word_index: None,
state: state_for,
order_module: Fsrs(FsrsModule::new()),
open_mode: settings.open_mode,
settings: settings.clone(),
})
todo!()
// let state_for = state.clone();
//
// let stats = state (settings, &state.connection.read())?;
// let words = stats
// .iter()
// .map(|stat| {
// state
// .dictionary
// .binary_search_by_key(&stat.word_id, |w| w.id)
// .expect("No word found in dictionary")
// })
// .map(|index| &state.dictionary[index])
// .cloned()
// .collect();
//
// Ok(Self {
// set: stats,
// words,
// current_word_index: None,
// state: state_for,
// order_module: Fsrs(FsrsModule::new()),
// open_mode: settings.open_mode,
// settings: settings.clone(),
// })
}
pub fn next(&mut self) -> (WordData, CardState) {