Anki/rslib/src/backend/sched/states/review.rs
Damien Elmes f165576992 implement leech handling
Also change the default for new users to "tag only"
2021-02-23 17:35:20 +10:00

28 lines
928 B
Rust

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use crate::{backend_proto as pb, sched::states::ReviewState};
impl From<pb::scheduling_state::Review> for ReviewState {
fn from(state: pb::scheduling_state::Review) -> Self {
ReviewState {
scheduled_days: state.scheduled_days,
elapsed_days: state.elapsed_days,
ease_factor: state.ease_factor,
lapses: state.lapses,
leeched: state.leeched,
}
}
}
impl From<ReviewState> for pb::scheduling_state::Review {
fn from(state: ReviewState) -> Self {
pb::scheduling_state::Review {
scheduled_days: state.scheduled_days,
elapsed_days: state.elapsed_days,
ease_factor: state.ease_factor,
lapses: state.lapses,
leeched: state.leeched,
}
}
}