Anki/rslib/src/scheduler/states/new.rs
Damien Elmes 64ebc32b3d tidy up Rust imports
rustfmt can do this automatically, but only when run with a nightly
toolchain, so it needs to be manually done for now - see rslib/rusfmt.toml
2021-04-18 18:38:54 +10:00

22 lines
702 B
Rust

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use super::interval_kind::IntervalKind;
use crate::revlog::RevlogReviewKind;
#[derive(Debug, Clone, Copy, PartialEq, Default)]
pub struct NewState {
pub position: u32,
}
impl NewState {
pub(crate) fn interval_kind(self) -> IntervalKind {
// todo: consider packing the due number in here; it would allow us to restore the
// original position of cards - though not as cheaply as if it were a card property.
IntervalKind::InSecs(0)
}
pub(crate) fn revlog_kind(self) -> RevlogReviewKind {
RevlogReviewKind::Learning
}
}