diff --git a/rslib/src/backend/mod.rs b/rslib/src/backend/mod.rs index 8e89f5c19..9dfece2c5 100644 --- a/rslib/src/backend/mod.rs +++ b/rslib/src/backend/mod.rs @@ -30,7 +30,7 @@ use crate::{ notetype::{ all_stock_notetypes, CardTemplateSchema11, NoteType, NoteTypeSchema11, RenderCardOutput, }, - sched::{ + scheduler::{ new::NewCardSortOrder, parse_due_date_str, states::{CardState, NextCardStates}, @@ -71,7 +71,7 @@ use tokio::runtime::{self, Runtime}; mod dbproxy; mod generic; mod http_sync_server; -mod sched; +mod scheduler; struct ThrottlingProgressHandler { state: Arc>, @@ -2059,8 +2059,8 @@ fn pbcard_to_native(c: pb::Card) -> Result { }) } -impl From for pb::SchedTimingTodayOut { - fn from(t: crate::sched::cutoff::SchedTimingToday) -> pb::SchedTimingTodayOut { +impl From for pb::SchedTimingTodayOut { + fn from(t: crate::scheduler::cutoff::SchedTimingToday) -> pb::SchedTimingTodayOut { pb::SchedTimingTodayOut { days_elapsed: t.days_elapsed, next_day_at: t.next_day_at, diff --git a/rslib/src/backend/sched/answering.rs b/rslib/src/backend/scheduler/answering.rs similarity index 95% rename from rslib/src/backend/sched/answering.rs rename to rslib/src/backend/scheduler/answering.rs index 7af53769c..8d6942bf0 100644 --- a/rslib/src/backend/sched/answering.rs +++ b/rslib/src/backend/scheduler/answering.rs @@ -4,7 +4,7 @@ use crate::{ backend_proto as pb, prelude::*, - sched::answering::{CardAnswer, Rating}, + scheduler::answering::{CardAnswer, Rating}, }; impl From for CardAnswer { diff --git a/rslib/src/backend/sched/mod.rs b/rslib/src/backend/scheduler/mod.rs similarity index 100% rename from rslib/src/backend/sched/mod.rs rename to rslib/src/backend/scheduler/mod.rs diff --git a/rslib/src/backend/sched/states/filtered.rs b/rslib/src/backend/scheduler/states/filtered.rs similarity index 94% rename from rslib/src/backend/sched/states/filtered.rs rename to rslib/src/backend/scheduler/states/filtered.rs index 98283059d..fabee58bf 100644 --- a/rslib/src/backend/sched/states/filtered.rs +++ b/rslib/src/backend/scheduler/states/filtered.rs @@ -1,7 +1,7 @@ // 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::FilteredState}; +use crate::{backend_proto as pb, scheduler::states::FilteredState}; impl From for pb::scheduling_state::Filtered { fn from(state: FilteredState) -> Self { diff --git a/rslib/src/backend/sched/states/learning.rs b/rslib/src/backend/scheduler/states/learning.rs similarity index 90% rename from rslib/src/backend/sched/states/learning.rs rename to rslib/src/backend/scheduler/states/learning.rs index 95e393211..55f56e3d1 100644 --- a/rslib/src/backend/sched/states/learning.rs +++ b/rslib/src/backend/scheduler/states/learning.rs @@ -1,7 +1,7 @@ // 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::LearnState}; +use crate::{backend_proto as pb, scheduler::states::LearnState}; impl From for LearnState { fn from(state: pb::scheduling_state::Learning) -> Self { diff --git a/rslib/src/backend/sched/states/mod.rs b/rslib/src/backend/scheduler/states/mod.rs similarity index 96% rename from rslib/src/backend/sched/states/mod.rs rename to rslib/src/backend/scheduler/states/mod.rs index bd69570b6..f82865aba 100644 --- a/rslib/src/backend/sched/states/mod.rs +++ b/rslib/src/backend/scheduler/states/mod.rs @@ -12,7 +12,7 @@ mod review; use crate::{ backend_proto as pb, - sched::states::{CardState, NewState, NextCardStates, NormalState}, + scheduler::states::{CardState, NewState, NextCardStates, NormalState}, }; impl From for pb::NextCardStates { diff --git a/rslib/src/backend/sched/states/new.rs b/rslib/src/backend/scheduler/states/new.rs similarity index 88% rename from rslib/src/backend/sched/states/new.rs rename to rslib/src/backend/scheduler/states/new.rs index 66b7fe7bf..2faf20ae1 100644 --- a/rslib/src/backend/sched/states/new.rs +++ b/rslib/src/backend/scheduler/states/new.rs @@ -1,7 +1,7 @@ // 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::NewState}; +use crate::{backend_proto as pb, scheduler::states::NewState}; impl From for NewState { fn from(state: pb::scheduling_state::New) -> Self { diff --git a/rslib/src/backend/sched/states/normal.rs b/rslib/src/backend/scheduler/states/normal.rs similarity index 96% rename from rslib/src/backend/sched/states/normal.rs rename to rslib/src/backend/scheduler/states/normal.rs index 86e26e0db..f332bc117 100644 --- a/rslib/src/backend/sched/states/normal.rs +++ b/rslib/src/backend/scheduler/states/normal.rs @@ -1,7 +1,7 @@ // 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::NormalState}; +use crate::{backend_proto as pb, scheduler::states::NormalState}; impl From for pb::scheduling_state::Normal { fn from(state: NormalState) -> Self { diff --git a/rslib/src/backend/sched/states/preview.rs b/rslib/src/backend/scheduler/states/preview.rs similarity index 91% rename from rslib/src/backend/sched/states/preview.rs rename to rslib/src/backend/scheduler/states/preview.rs index 9b2202a0a..c09876820 100644 --- a/rslib/src/backend/sched/states/preview.rs +++ b/rslib/src/backend/scheduler/states/preview.rs @@ -1,7 +1,7 @@ // 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::PreviewState}; +use crate::{backend_proto as pb, scheduler::states::PreviewState}; impl From for PreviewState { fn from(state: pb::scheduling_state::Preview) -> Self { diff --git a/rslib/src/backend/sched/states/relearning.rs b/rslib/src/backend/scheduler/states/relearning.rs similarity index 91% rename from rslib/src/backend/sched/states/relearning.rs rename to rslib/src/backend/scheduler/states/relearning.rs index 2a737d17a..205033c50 100644 --- a/rslib/src/backend/sched/states/relearning.rs +++ b/rslib/src/backend/scheduler/states/relearning.rs @@ -1,7 +1,7 @@ // 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::RelearnState}; +use crate::{backend_proto as pb, scheduler::states::RelearnState}; impl From for RelearnState { fn from(state: pb::scheduling_state::Relearning) -> Self { diff --git a/rslib/src/backend/sched/states/rescheduling.rs b/rslib/src/backend/scheduler/states/rescheduling.rs similarity index 89% rename from rslib/src/backend/sched/states/rescheduling.rs rename to rslib/src/backend/scheduler/states/rescheduling.rs index 225c27ab7..d32e8a137 100644 --- a/rslib/src/backend/sched/states/rescheduling.rs +++ b/rslib/src/backend/scheduler/states/rescheduling.rs @@ -1,7 +1,7 @@ // 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::ReschedulingFilterState}; +use crate::{backend_proto as pb, scheduler::states::ReschedulingFilterState}; impl From for ReschedulingFilterState { fn from(state: pb::scheduling_state::ReschedulingFilter) -> Self { diff --git a/rslib/src/backend/sched/states/review.rs b/rslib/src/backend/scheduler/states/review.rs similarity index 92% rename from rslib/src/backend/sched/states/review.rs rename to rslib/src/backend/scheduler/states/review.rs index a75bf113f..ec047bd87 100644 --- a/rslib/src/backend/sched/states/review.rs +++ b/rslib/src/backend/scheduler/states/review.rs @@ -1,7 +1,7 @@ // 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}; +use crate::{backend_proto as pb, scheduler::states::ReviewState}; impl From for ReviewState { fn from(state: pb::scheduling_state::Review) -> Self { diff --git a/rslib/src/deckconf/mod.rs b/rslib/src/deckconf/mod.rs index f0258e9e0..f15203309 100644 --- a/rslib/src/deckconf/mod.rs +++ b/rslib/src/deckconf/mod.rs @@ -5,7 +5,7 @@ use crate::{ collection::Collection, define_newtype, err::{AnkiError, Result}, - sched::states::review::INITIAL_EASE_FACTOR, + scheduler::states::review::INITIAL_EASE_FACTOR, timestamp::{TimestampMillis, TimestampSecs}, types::Usn, }; diff --git a/rslib/src/lib.rs b/rslib/src/lib.rs index ca91003ab..59ba18842 100644 --- a/rslib/src/lib.rs +++ b/rslib/src/lib.rs @@ -26,7 +26,7 @@ pub mod notetype; mod preferences; pub mod prelude; pub mod revlog; -pub mod sched; +pub mod scheduler; pub mod search; pub mod serde; mod stats; diff --git a/rslib/src/preferences.rs b/rslib/src/preferences.rs index 4237fcd3d..1ec03c9e5 100644 --- a/rslib/src/preferences.rs +++ b/rslib/src/preferences.rs @@ -8,7 +8,7 @@ use crate::{ }, collection::Collection, err::Result, - sched::cutoff::local_minutes_west_for_stamp, + scheduler::cutoff::local_minutes_west_for_stamp, }; impl Collection { diff --git a/rslib/src/sched/answering.rs b/rslib/src/scheduler/answering.rs similarity index 100% rename from rslib/src/sched/answering.rs rename to rslib/src/scheduler/answering.rs diff --git a/rslib/src/sched/bury_and_suspend.rs b/rslib/src/scheduler/bury_and_suspend.rs similarity index 100% rename from rslib/src/sched/bury_and_suspend.rs rename to rslib/src/scheduler/bury_and_suspend.rs diff --git a/rslib/src/sched/congrats.rs b/rslib/src/scheduler/congrats.rs similarity index 100% rename from rslib/src/sched/congrats.rs rename to rslib/src/scheduler/congrats.rs diff --git a/rslib/src/sched/cutoff.rs b/rslib/src/scheduler/cutoff.rs similarity index 100% rename from rslib/src/sched/cutoff.rs rename to rslib/src/scheduler/cutoff.rs diff --git a/rslib/src/sched/learning.rs b/rslib/src/scheduler/learning.rs similarity index 100% rename from rslib/src/sched/learning.rs rename to rslib/src/scheduler/learning.rs diff --git a/rslib/src/sched/mod.rs b/rslib/src/scheduler/mod.rs similarity index 100% rename from rslib/src/sched/mod.rs rename to rslib/src/scheduler/mod.rs diff --git a/rslib/src/sched/new.rs b/rslib/src/scheduler/new.rs similarity index 100% rename from rslib/src/sched/new.rs rename to rslib/src/scheduler/new.rs diff --git a/rslib/src/sched/reviews.rs b/rslib/src/scheduler/reviews.rs similarity index 100% rename from rslib/src/sched/reviews.rs rename to rslib/src/scheduler/reviews.rs diff --git a/rslib/src/sched/states/filtered.rs b/rslib/src/scheduler/states/filtered.rs similarity index 100% rename from rslib/src/sched/states/filtered.rs rename to rslib/src/scheduler/states/filtered.rs diff --git a/rslib/src/sched/states/interval_kind.rs b/rslib/src/scheduler/states/interval_kind.rs similarity index 100% rename from rslib/src/sched/states/interval_kind.rs rename to rslib/src/scheduler/states/interval_kind.rs diff --git a/rslib/src/sched/states/learning.rs b/rslib/src/scheduler/states/learning.rs similarity index 100% rename from rslib/src/sched/states/learning.rs rename to rslib/src/scheduler/states/learning.rs diff --git a/rslib/src/sched/states/mod.rs b/rslib/src/scheduler/states/mod.rs similarity index 100% rename from rslib/src/sched/states/mod.rs rename to rslib/src/scheduler/states/mod.rs diff --git a/rslib/src/sched/states/new.rs b/rslib/src/scheduler/states/new.rs similarity index 100% rename from rslib/src/sched/states/new.rs rename to rslib/src/scheduler/states/new.rs diff --git a/rslib/src/sched/states/normal.rs b/rslib/src/scheduler/states/normal.rs similarity index 100% rename from rslib/src/sched/states/normal.rs rename to rslib/src/scheduler/states/normal.rs diff --git a/rslib/src/sched/states/preview_filter.rs b/rslib/src/scheduler/states/preview_filter.rs similarity index 100% rename from rslib/src/sched/states/preview_filter.rs rename to rslib/src/scheduler/states/preview_filter.rs diff --git a/rslib/src/sched/states/relearning.rs b/rslib/src/scheduler/states/relearning.rs similarity index 100% rename from rslib/src/sched/states/relearning.rs rename to rslib/src/scheduler/states/relearning.rs diff --git a/rslib/src/sched/states/rescheduling_filter.rs b/rslib/src/scheduler/states/rescheduling_filter.rs similarity index 100% rename from rslib/src/sched/states/rescheduling_filter.rs rename to rslib/src/scheduler/states/rescheduling_filter.rs diff --git a/rslib/src/sched/states/review.rs b/rslib/src/scheduler/states/review.rs similarity index 100% rename from rslib/src/sched/states/review.rs rename to rslib/src/scheduler/states/review.rs diff --git a/rslib/src/sched/states/steps.rs b/rslib/src/scheduler/states/steps.rs similarity index 100% rename from rslib/src/sched/states/steps.rs rename to rslib/src/scheduler/states/steps.rs diff --git a/rslib/src/sched/timespan.rs b/rslib/src/scheduler/timespan.rs similarity index 98% rename from rslib/src/sched/timespan.rs rename to rslib/src/scheduler/timespan.rs index 9aefaea11..4c5ce2749 100644 --- a/rslib/src/sched/timespan.rs +++ b/rslib/src/scheduler/timespan.rs @@ -167,7 +167,7 @@ impl Timespan { mod test { use crate::i18n::I18n; use crate::log; - use crate::sched::timespan::{answer_button_time, time_span, MONTH}; + use crate::scheduler::timespan::{answer_button_time, time_span, MONTH}; #[test] fn answer_buttons() { diff --git a/rslib/src/sched/upgrade.rs b/rslib/src/scheduler/upgrade.rs similarity index 100% rename from rslib/src/sched/upgrade.rs rename to rslib/src/scheduler/upgrade.rs diff --git a/rslib/src/stats/card.rs b/rslib/src/stats/card.rs index 4b264f29e..549613e4a 100644 --- a/rslib/src/stats/card.rs +++ b/rslib/src/stats/card.rs @@ -6,7 +6,7 @@ use crate::{ i18n::I18n, prelude::*, revlog::{RevlogEntry, RevlogReviewKind}, - sched::timespan::time_span, + scheduler::timespan::time_span, }; use askama::Template; use chrono::prelude::*; diff --git a/rslib/src/stats/today.rs b/rslib/src/stats/today.rs index 27b1a0b4e..3886dddfe 100644 --- a/rslib/src/stats/today.rs +++ b/rslib/src/stats/today.rs @@ -1,7 +1,7 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -use crate::{i18n::I18n, prelude::*, sched::timespan::Timespan}; +use crate::{i18n::I18n, prelude::*, scheduler::timespan::Timespan}; pub fn studied_today(cards: u32, secs: f32, i18n: &I18n) -> String { let span = Timespan::from_secs(secs).natural_span(); diff --git a/rslib/src/storage/card/mod.rs b/rslib/src/storage/card/mod.rs index 5f733bfe6..4b9fa7168 100644 --- a/rslib/src/storage/card/mod.rs +++ b/rslib/src/storage/card/mod.rs @@ -7,7 +7,7 @@ use crate::{ decks::{Deck, DeckID, DeckKind}, err::Result, notes::NoteID, - sched::congrats::CongratsInfo, + scheduler::congrats::CongratsInfo, timestamp::{TimestampMillis, TimestampSecs}, types::Usn, }; diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index 6695538de..4030de0aa 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -5,7 +5,7 @@ use crate::config::schema11_config_as_string; use crate::err::Result; use crate::err::{AnkiError, DBErrorKind}; use crate::timestamp::{TimestampMillis, TimestampSecs}; -use crate::{i18n::I18n, sched::cutoff::v1_creation_date, text::without_combining}; +use crate::{i18n::I18n, scheduler::cutoff::v1_creation_date, text::without_combining}; use regex::Regex; use rusqlite::{functions::FunctionFlags, params, Connection, NO_PARAMS}; use std::cmp::Ordering;