mirror of
https://github.com/ankitects/anki.git
synced 2025-11-28 15:37:13 -05:00
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
22 lines
702 B
Rust
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
|
|
}
|
|
}
|