Introduce MaybeError type
This commit is contained in:
1 parent
d836b57d2a
commit
a60ed37cd4
16 files changed
+127
-93
No files matched your search
+2
-2
@@ -6,7 +6,7 @@ use crate::core::srs::{
|
||||
use crate::data::entities::*;
|
||||
use crate::data_provider::card_stats::{load_stats_of_deck, update_stat_score};
|
||||
use crate::data_provider::history::push_note;
|
||||
use crate::notification::NotificationData;
|
||||
use crate::notification::{MaybeError, NotificationData};
|
||||
use chrono::Utc;
|
||||
use parking_lot::Mutex;
|
||||
use std::sync::Arc;
|
||||
@@ -88,7 +88,7 @@ impl DeckData {
|
||||
self.current_word_index = Some(index);
|
||||
(self.words[index].clone(), self.set[index].clone())
|
||||
}
|
||||
pub fn open(&mut self, status: WordOpenMode) -> Result<(), NotificationData> {
|
||||
pub fn open(&mut self, status: WordOpenMode) -> MaybeError {
|
||||
if let Some(index) = self.current_word_index {
|
||||
let word: &mut CardStatistics = &mut self.set[index];
|
||||
let old_score = word.score;
|
||||
|
||||
Reference in new issue
Block a user