mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
cargo clippy
This commit is contained in:
parent
91e729be1e
commit
f4f8f103f4
1 changed files with 10 additions and 13 deletions
|
|
@ -130,20 +130,17 @@ impl Card {
|
|||
pub(crate) fn days_since_last_review(&self, timing: &SchedTimingToday) -> Option<u32> {
|
||||
if let Some(last_review_time) = self.last_review_time {
|
||||
Some(timing.next_day_at.elapsed_days_since(last_review_time) as u32)
|
||||
} else if !self.is_due_in_days() {
|
||||
Some(
|
||||
(timing.next_day_at.0 as u32).saturating_sub(self.original_or_current_due() as u32)
|
||||
/ 86_400,
|
||||
)
|
||||
} else {
|
||||
if !self.is_due_in_days() {
|
||||
Some(
|
||||
(timing.next_day_at.0 as u32)
|
||||
.saturating_sub(self.original_or_current_due() as u32)
|
||||
/ 86_400,
|
||||
)
|
||||
} else {
|
||||
self.due_time(timing).map(|due| {
|
||||
(due.adding_secs(-86_400 * self.interval as i64)
|
||||
.elapsed_secs()
|
||||
/ 86_400) as u32
|
||||
})
|
||||
}
|
||||
self.due_time(timing).map(|due| {
|
||||
(due.adding_secs(-86_400 * self.interval as i64)
|
||||
.elapsed_secs()
|
||||
/ 86_400) as u32
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue