diff --git a/rslib/build/protobuf.rs b/rslib/build/protobuf.rs index 6aeaa748e..77d375d3a 100644 --- a/rslib/build/protobuf.rs +++ b/rslib/build/protobuf.rs @@ -29,7 +29,7 @@ pub trait Service { } buf.push_str( r#" - _ => Err(crate::err::AnkiError::invalid_input("invalid command")), + _ => Err(crate::error::AnkiError::invalid_input("invalid command")), } } "#, @@ -58,7 +58,7 @@ impl prost_build::ServiceGenerator for CustomGenerator { "pub mod {name}_service {{ use super::*; use prost::Message; - use crate::err::Result; + use crate::error::Result; ", name = service.name.replace("Service", "").to_ascii_lowercase() ) diff --git a/rslib/src/backend/dbproxy.rs b/rslib/src/backend/dbproxy.rs index eae2ace94..56cf200fb 100644 --- a/rslib/src/backend/dbproxy.rs +++ b/rslib/src/backend/dbproxy.rs @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use crate::storage::SqliteStorage; -use crate::{collection::Collection, err::Result}; +use crate::{collection::Collection, error::Result}; use rusqlite::types::{FromSql, FromSqlError, ToSql, ToSqlOutput, ValueRef}; use rusqlite::OptionalExtension; use serde_derive::{Deserialize, Serialize}; diff --git a/rslib/src/backend/err.rs b/rslib/src/backend/err.rs index 512278933..2e67b5ffc 100644 --- a/rslib/src/backend/err.rs +++ b/rslib/src/backend/err.rs @@ -3,7 +3,7 @@ use crate::{ backend_proto as pb, - err::{AnkiError, NetworkErrorKind, SyncErrorKind}, + error::{AnkiError, NetworkErrorKind, SyncErrorKind}, prelude::*, }; diff --git a/rslib/src/backend/mod.rs b/rslib/src/backend/mod.rs index b202511f6..526aa169d 100644 --- a/rslib/src/backend/mod.rs +++ b/rslib/src/backend/mod.rs @@ -49,7 +49,7 @@ use crate::{ backend::dbproxy::db_command_bytes, backend_proto as pb, collection::Collection, - err::{AnkiError, Result}, + error::{AnkiError, Result}, i18n::I18n, }; use once_cell::sync::OnceCell; diff --git a/rslib/src/backend/sync/server.rs b/rslib/src/backend/sync/server.rs index 8b4816e9f..7f98ffc05 100644 --- a/rslib/src/backend/sync/server.rs +++ b/rslib/src/backend/sync/server.rs @@ -6,7 +6,7 @@ use tokio::runtime::Runtime; use crate::backend::{Backend, BackendState}; use crate::{ - err::SyncErrorKind, + error::SyncErrorKind, prelude::*, sync::{ http::{ diff --git a/rslib/src/browser_table.rs b/rslib/src/browser_table.rs index c1fb265cc..6bcf60fdc 100644 --- a/rslib/src/browser_table.rs +++ b/rslib/src/browser_table.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use itertools::Itertools; use serde_repr::{Deserialize_repr, Serialize_repr}; -use crate::err::{AnkiError, Result}; +use crate::error::{AnkiError, Result}; use crate::i18n::I18n; use crate::{ card::{Card, CardId, CardQueue, CardType}, diff --git a/rslib/src/card/mod.rs b/rslib/src/card/mod.rs index 037cbd1eb..06cb1afc5 100644 --- a/rslib/src/card/mod.rs +++ b/rslib/src/card/mod.rs @@ -3,7 +3,7 @@ pub(crate) mod undo; -use crate::err::{AnkiError, Result}; +use crate::error::{AnkiError, Result}; use crate::notes::NoteId; use crate::{ collection::Collection, config::SchedulerVersion, prelude::*, timestamp::TimestampSecs, diff --git a/rslib/src/collection.rs b/rslib/src/collection.rs index d213052d0..928cd2c99 100644 --- a/rslib/src/collection.rs +++ b/rslib/src/collection.rs @@ -10,7 +10,7 @@ use crate::{ storage::SqliteStorage, undo::UndoManager, }; -use crate::{err::Result, scheduler::queue::CardQueues}; +use crate::{error::Result, scheduler::queue::CardQueues}; use crate::{i18n::I18n, ops::StateChanges}; use std::{collections::HashMap, path::PathBuf, sync::Arc}; diff --git a/rslib/src/dbcheck.rs b/rslib/src/dbcheck.rs index 9abbe1e48..1e56db5ea 100644 --- a/rslib/src/dbcheck.rs +++ b/rslib/src/dbcheck.rs @@ -4,7 +4,7 @@ use crate::{ collection::Collection, config::SchedulerVersion, - err::{AnkiError, DbErrorKind, Result}, + error::{AnkiError, DbErrorKind, Result}, i18n::I18n, notetype::{ all_stock_notetypes, AlreadyGeneratedCardInfo, CardGenContext, Notetype, NotetypeId, diff --git a/rslib/src/deckconf/mod.rs b/rslib/src/deckconf/mod.rs index 491354fbc..41f13af0b 100644 --- a/rslib/src/deckconf/mod.rs +++ b/rslib/src/deckconf/mod.rs @@ -4,7 +4,7 @@ use crate::{ collection::Collection, define_newtype, - err::{AnkiError, Result}, + error::{AnkiError, Result}, scheduler::states::review::INITIAL_EASE_FACTOR, timestamp::{TimestampMillis, TimestampSecs}, types::Usn, diff --git a/rslib/src/decks/counts.rs b/rslib/src/decks/counts.rs index 7c13302de..26f547864 100644 --- a/rslib/src/decks/counts.rs +++ b/rslib/src/decks/counts.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::{collection::Collection, decks::DeckId, err::Result}; +use crate::{collection::Collection, decks::DeckId, error::Result}; use std::collections::HashMap; #[derive(Debug)] diff --git a/rslib/src/decks/mod.rs b/rslib/src/decks/mod.rs index 714d8013b..e102ae46e 100644 --- a/rslib/src/decks/mod.rs +++ b/rslib/src/decks/mod.rs @@ -17,7 +17,7 @@ use crate::{ collection::Collection, deckconf::DeckConfId, define_newtype, - err::{AnkiError, Result}, + error::{AnkiError, Result}, prelude::*, text::normalize_to_nfc, timestamp::TimestampSecs, @@ -693,7 +693,7 @@ mod test { use crate::decks::reparented_name; use crate::{ collection::{open_test_collection, Collection}, - err::Result, + error::Result, search::SortMode, }; diff --git a/rslib/src/decks/tree.rs b/rslib/src/decks/tree.rs index 01d729613..23d3a9d2d 100644 --- a/rslib/src/decks/tree.rs +++ b/rslib/src/decks/tree.rs @@ -8,7 +8,7 @@ use crate::{ config::{BoolKey, SchedulerVersion}, deckconf::{DeckConf, DeckConfId}, decks::DeckId, - err::Result, + error::Result, timestamp::TimestampSecs, }; use serde_tuple::Serialize_tuple; @@ -338,7 +338,7 @@ impl Collection { #[cfg(test)] mod test { use super::*; - use crate::{collection::open_test_collection, deckconf::DeckConfId, err::Result}; + use crate::{collection::open_test_collection, deckconf::DeckConfId, error::Result}; #[test] fn wellformed() -> Result<()> { diff --git a/rslib/src/err.rs b/rslib/src/error/mod.rs similarity index 100% rename from rslib/src/err.rs rename to rslib/src/error/mod.rs diff --git a/rslib/src/findreplace.rs b/rslib/src/findreplace.rs index 84fd2e519..2b5d60c41 100644 --- a/rslib/src/findreplace.rs +++ b/rslib/src/findreplace.rs @@ -3,7 +3,7 @@ use crate::{ collection::Collection, - err::{AnkiError, Result}, + error::{AnkiError, Result}, notes::{NoteId, TransformNoteOutput}, prelude::*, text::normalize_to_nfc, diff --git a/rslib/src/lib.rs b/rslib/src/lib.rs index a277e6cb0..ff14467c6 100644 --- a/rslib/src/lib.rs +++ b/rslib/src/lib.rs @@ -14,7 +14,7 @@ pub mod config; pub mod dbcheck; pub mod deckconf; pub mod decks; -pub mod err; +pub mod error; pub mod findreplace; pub mod i18n; pub mod latex; diff --git a/rslib/src/media/changetracker.rs b/rslib/src/media/changetracker.rs index 642d1c6f7..93b9b805e 100644 --- a/rslib/src/media/changetracker.rs +++ b/rslib/src/media/changetracker.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::err::{AnkiError, Result}; +use crate::error::{AnkiError, Result}; use crate::log::{debug, Logger}; use crate::media::database::{MediaDatabaseContext, MediaEntry}; use crate::media::files::{ @@ -244,7 +244,7 @@ where #[cfg(test)] mod test { - use crate::err::Result; + use crate::error::Result; use crate::media::changetracker::ChangeTracker; use crate::media::database::MediaEntry; use crate::media::files::sha1_of_data; diff --git a/rslib/src/media/check.rs b/rslib/src/media/check.rs index fb87fa61f..9de433df0 100644 --- a/rslib/src/media/check.rs +++ b/rslib/src/media/check.rs @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use crate::collection::Collection; -use crate::err::{AnkiError, DbErrorKind, Result}; +use crate::error::{AnkiError, DbErrorKind, Result}; use crate::latex::extract_latex_expanding_clozes; use crate::log::debug; use crate::media::database::MediaDatabaseContext; @@ -511,7 +511,7 @@ pub(crate) mod test { use super::normalize_and_maybe_rename_files; use crate::collection::{open_collection, Collection}; - use crate::err::Result; + use crate::error::Result; use crate::i18n::I18n; use crate::log; use crate::media::check::{MediaCheckOutput, MediaChecker}; diff --git a/rslib/src/media/database.rs b/rslib/src/media/database.rs index 3d5fe1c92..6bf58fa63 100644 --- a/rslib/src/media/database.rs +++ b/rslib/src/media/database.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::err::Result; +use crate::error::Result; use rusqlite::{params, Connection, OptionalExtension, Row, Statement, NO_PARAMS}; use std::collections::HashMap; use std::path::Path; @@ -251,7 +251,7 @@ fn row_to_entry(row: &Row) -> rusqlite::Result { #[cfg(test)] mod test { - use crate::err::Result; + use crate::error::Result; use crate::media::database::MediaEntry; use crate::media::files::sha1_of_data; use crate::media::MediaManager; diff --git a/rslib/src/media/files.rs b/rslib/src/media/files.rs index c6bc7446f..bc6d2feb3 100644 --- a/rslib/src/media/files.rs +++ b/rslib/src/media/files.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::err::{AnkiError, Result}; +use crate::error::{AnkiError, Result}; use crate::log::{debug, Logger}; use lazy_static::lazy_static; use regex::Regex; diff --git a/rslib/src/media/mod.rs b/rslib/src/media/mod.rs index 17a02943c..5909cdb4c 100644 --- a/rslib/src/media/mod.rs +++ b/rslib/src/media/mod.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::err::Result; +use crate::error::Result; use crate::media::database::{open_or_create, MediaDatabaseContext, MediaEntry}; use crate::media::files::{add_data_to_folder_uniquely, mtime_as_i64, remove_files, sha1_of_data}; use crate::media::sync::{MediaSyncProgress, MediaSyncer}; diff --git a/rslib/src/media/sync.rs b/rslib/src/media/sync.rs index 66e8f10b0..c1983c838 100644 --- a/rslib/src/media/sync.rs +++ b/rslib/src/media/sync.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::err::{AnkiError, Result, SyncErrorKind}; +use crate::error::{AnkiError, Result, SyncErrorKind}; use crate::media::changetracker::ChangeTracker; use crate::media::database::{MediaDatabaseContext, MediaDatabaseMetadata, MediaEntry}; use crate::media::files::{ @@ -808,7 +808,7 @@ fn zip_files<'a>( #[cfg(test)] mod test { - use crate::err::Result; + use crate::error::Result; use crate::media::sync::{ determine_required_change, LocalState, MediaSyncProgress, RequiredChange, }; diff --git a/rslib/src/notes/mod.rs b/rslib/src/notes/mod.rs index 9a61a90a5..34c3a3bb3 100644 --- a/rslib/src/notes/mod.rs +++ b/rslib/src/notes/mod.rs @@ -7,7 +7,7 @@ use crate::{ backend_proto as pb, decks::DeckId, define_newtype, - err::{AnkiError, Result}, + error::{AnkiError, Result}, notetype::{CardGenContext, NoteField, Notetype, NotetypeId}, prelude::*, template::field_is_empty, @@ -570,7 +570,7 @@ fn note_differs_from_db(existing_note: &mut Note, note: &mut Note) -> bool { mod test { use super::{anki_base91, field_checksum}; use crate::{ - collection::open_test_collection, config::BoolKey, decks::DeckId, err::Result, prelude::*, + collection::open_test_collection, config::BoolKey, decks::DeckId, error::Result, prelude::*, search::SortMode, }; diff --git a/rslib/src/notetype/cardgen.rs b/rslib/src/notetype/cardgen.rs index c1447f7d2..717d807ab 100644 --- a/rslib/src/notetype/cardgen.rs +++ b/rslib/src/notetype/cardgen.rs @@ -8,7 +8,7 @@ use crate::{ collection::Collection, deckconf::{DeckConf, DeckConfId}, decks::DeckId, - err::{AnkiError, Result}, + error::{AnkiError, Result}, notes::{Note, NoteId}, notetype::NotetypeKind, template::ParsedTemplate, diff --git a/rslib/src/notetype/emptycards.rs b/rslib/src/notetype/emptycards.rs index 4ac162c04..e2b6067c9 100644 --- a/rslib/src/notetype/emptycards.rs +++ b/rslib/src/notetype/emptycards.rs @@ -4,7 +4,7 @@ use super::{ cardgen::group_generated_cards_by_note, CardGenContext, Notetype, NotetypeId, NotetypeKind, }; -use crate::{card::CardId, collection::Collection, err::Result, notes::NoteId}; +use crate::{card::CardId, collection::Collection, error::Result, notes::NoteId}; use std::collections::HashSet; use std::fmt::Write; diff --git a/rslib/src/notetype/fields.rs b/rslib/src/notetype/fields.rs index 50b50c866..be8a8bff1 100644 --- a/rslib/src/notetype/fields.rs +++ b/rslib/src/notetype/fields.rs @@ -3,7 +3,7 @@ use crate::{ backend_proto::{NoteField as NoteFieldProto, NoteFieldConfig, OptionalUInt32}, - err::{AnkiError, Result}, + error::{AnkiError, Result}, }; #[derive(Debug, PartialEq)] diff --git a/rslib/src/notetype/mod.rs b/rslib/src/notetype/mod.rs index 12b1fc885..5504d1eef 100644 --- a/rslib/src/notetype/mod.rs +++ b/rslib/src/notetype/mod.rs @@ -26,7 +26,7 @@ use crate::{ collection::Collection, decks::DeckId, define_newtype, - err::{AnkiError, Result}, + error::{AnkiError, Result}, notes::Note, prelude::*, template::{FieldRequirements, ParsedTemplate}, diff --git a/rslib/src/notetype/render.rs b/rslib/src/notetype/render.rs index eb1a02585..de6111a23 100644 --- a/rslib/src/notetype/render.rs +++ b/rslib/src/notetype/render.rs @@ -5,7 +5,7 @@ use super::{CardTemplate, Notetype, NotetypeKind}; use crate::{ card::{Card, CardId}, collection::Collection, - err::{AnkiError, Result}, + error::{AnkiError, Result}, i18n::I18n, notes::{Note, NoteId}, template::{field_is_empty, render_card, ParsedTemplate, RenderedNode}, diff --git a/rslib/src/notetype/schemachange.rs b/rslib/src/notetype/schemachange.rs index 1521c727b..455823e08 100644 --- a/rslib/src/notetype/schemachange.rs +++ b/rslib/src/notetype/schemachange.rs @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use super::{CardGenContext, Notetype}; -use crate::{collection::Collection, err::Result}; +use crate::{collection::Collection, error::Result}; /// True if any ordinals added, removed or reordered. fn ords_changed(ords: &[Option], previous_len: usize) -> bool { @@ -137,7 +137,7 @@ impl Collection { #[cfg(test)] mod test { use super::{ords_changed, TemplateOrdChanges}; - use crate::{collection::open_test_collection, decks::DeckId, err::Result, search::SortMode}; + use crate::{collection::open_test_collection, decks::DeckId, error::Result, search::SortMode}; #[test] fn ord_changes() { diff --git a/rslib/src/notetype/stock.rs b/rslib/src/notetype/stock.rs index a1e53f8db..6c3a9a2f4 100644 --- a/rslib/src/notetype/stock.rs +++ b/rslib/src/notetype/stock.rs @@ -4,7 +4,7 @@ use super::NotetypeKind; use crate::{ config::{ConfigEntry, ConfigKey}, - err::Result, + error::Result, i18n::I18n, notetype::Notetype, storage::SqliteStorage, diff --git a/rslib/src/notetype/templates.rs b/rslib/src/notetype/templates.rs index e7e9434ff..692e2110c 100644 --- a/rslib/src/notetype/templates.rs +++ b/rslib/src/notetype/templates.rs @@ -4,7 +4,7 @@ use crate::{ backend_proto::{CardTemplate as CardTemplateProto, CardTemplateConfig, OptionalUInt32}, decks::DeckId, - err::{AnkiError, Result}, + error::{AnkiError, Result}, template::ParsedTemplate, timestamp::TimestampSecs, types::Usn, diff --git a/rslib/src/preferences.rs b/rslib/src/preferences.rs index 5f607a5b4..b7f690086 100644 --- a/rslib/src/preferences.rs +++ b/rslib/src/preferences.rs @@ -9,7 +9,7 @@ use crate::{ }, collection::Collection, config::BoolKey, - err::Result, + error::Result, prelude::*, scheduler::timing::local_minutes_west_for_stamp, }; diff --git a/rslib/src/prelude.rs b/rslib/src/prelude.rs index e30de9cdb..680066210 100644 --- a/rslib/src/prelude.rs +++ b/rslib/src/prelude.rs @@ -7,7 +7,7 @@ pub use crate::{ config::BoolKey, deckconf::{DeckConf, DeckConfId}, decks::{Deck, DeckId, DeckKind}, - err::{AnkiError, Result}, + error::{AnkiError, Result}, i18n::I18n, notes::{Note, NoteId}, notetype::{Notetype, NotetypeId}, diff --git a/rslib/src/scheduler/bury_and_suspend.rs b/rslib/src/scheduler/bury_and_suspend.rs index bdc221a19..0f51b313d 100644 --- a/rslib/src/scheduler/bury_and_suspend.rs +++ b/rslib/src/scheduler/bury_and_suspend.rs @@ -6,7 +6,7 @@ use crate::{ card::{Card, CardId, CardQueue}, collection::Collection, config::SchedulerVersion, - err::Result, + error::Result, prelude::*, search::SortMode, }; diff --git a/rslib/src/scheduler/mod.rs b/rslib/src/scheduler/mod.rs index 9b4b6e670..df7c4734a 100644 --- a/rslib/src/scheduler/mod.rs +++ b/rslib/src/scheduler/mod.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::{collection::Collection, config::SchedulerVersion, err::Result, prelude::*}; +use crate::{collection::Collection, config::SchedulerVersion, error::Result, prelude::*}; pub mod answering; pub mod bury_and_suspend; diff --git a/rslib/src/scheduler/new.rs b/rslib/src/scheduler/new.rs index 3166e5b5c..70a61ba1d 100644 --- a/rslib/src/scheduler/new.rs +++ b/rslib/src/scheduler/new.rs @@ -5,7 +5,7 @@ use crate::{ card::{Card, CardId, CardQueue, CardType}, collection::Collection, decks::DeckId, - err::Result, + error::Result, notes::NoteId, prelude::*, search::SortMode, diff --git a/rslib/src/scheduler/reviews.rs b/rslib/src/scheduler/reviews.rs index 6dc25c437..9fdd69095 100644 --- a/rslib/src/scheduler/reviews.rs +++ b/rslib/src/scheduler/reviews.rs @@ -6,7 +6,7 @@ use crate::{ collection::Collection, config::StringKey, deckconf::INITIAL_EASE_FACTOR_THOUSANDS, - err::Result, + error::Result, prelude::*, }; use lazy_static::lazy_static; diff --git a/rslib/src/search/mod.rs b/rslib/src/search/mod.rs index d3fa0a6ec..6f3d60ab4 100644 --- a/rslib/src/search/mod.rs +++ b/rslib/src/search/mod.rs @@ -18,7 +18,7 @@ use crate::{ card::CardType, collection::Collection, config::{BoolKey, SortKind}, - err::Result, + error::Result, notes::NoteId, prelude::AnkiError, search::parser::parse, diff --git a/rslib/src/search/parser.rs b/rslib/src/search/parser.rs index ce9d54c26..9317c450d 100644 --- a/rslib/src/search/parser.rs +++ b/rslib/src/search/parser.rs @@ -3,7 +3,7 @@ use crate::{ decks::DeckId, - err::{ParseError, Result, SearchErrorKind as FailKind}, + error::{ParseError, Result, SearchErrorKind as FailKind}, notetype::NotetypeId, }; use lazy_static::lazy_static; @@ -696,7 +696,7 @@ fn is_parser_escape(txt: &str) -> bool { #[cfg(test)] mod test { - use crate::err::SearchErrorKind; + use crate::error::SearchErrorKind; use super::*; @@ -858,7 +858,7 @@ mod test { #[test] fn errors() { - use crate::err::AnkiError; + use crate::error::AnkiError; use FailKind::*; fn assert_err_kind(input: &str, kind: FailKind) { diff --git a/rslib/src/search/sqlwriter.rs b/rslib/src/search/sqlwriter.rs index e5e150d8c..690343cec 100644 --- a/rslib/src/search/sqlwriter.rs +++ b/rslib/src/search/sqlwriter.rs @@ -9,7 +9,7 @@ use crate::{ card::{CardQueue, CardType}, collection::Collection, decks::human_deck_name_to_native, - err::Result, + error::Result, notes::field_checksum, notetype::NotetypeId, prelude::*, diff --git a/rslib/src/search/writer.rs b/rslib/src/search/writer.rs index 1767f2dbd..ecfd9e722 100644 --- a/rslib/src/search/writer.rs +++ b/rslib/src/search/writer.rs @@ -187,7 +187,7 @@ pub(crate) fn normalize_search(input: &str) -> Result { #[cfg(test)] mod test { use super::*; - use crate::err::Result; + use crate::error::Result; use crate::search::parse_search as parse; #[test] diff --git a/rslib/src/storage/card/mod.rs b/rslib/src/storage/card/mod.rs index 0df7b3720..7aad29c36 100644 --- a/rslib/src/storage/card/mod.rs +++ b/rslib/src/storage/card/mod.rs @@ -7,7 +7,7 @@ use crate::{ card::{Card, CardId, CardQueue, CardType}, deckconf::DeckConfId, decks::{Deck, DeckId, DeckKind}, - err::Result, + error::Result, notes::NoteId, scheduler::{ congrats::CongratsInfo, diff --git a/rslib/src/storage/config/mod.rs b/rslib/src/storage/config/mod.rs index d404002e4..6fad527e7 100644 --- a/rslib/src/storage/config/mod.rs +++ b/rslib/src/storage/config/mod.rs @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use super::SqliteStorage; -use crate::{config::ConfigEntry, err::Result, timestamp::TimestampSecs, types::Usn}; +use crate::{config::ConfigEntry, error::Result, timestamp::TimestampSecs, types::Usn}; use rusqlite::{params, NO_PARAMS}; use serde::de::DeserializeOwned; use serde_json::Value; diff --git a/rslib/src/storage/deck/mod.rs b/rslib/src/storage/deck/mod.rs index 0a6fbaec8..75c635638 100644 --- a/rslib/src/storage/deck/mod.rs +++ b/rslib/src/storage/deck/mod.rs @@ -8,7 +8,7 @@ use crate::{ config::SchedulerVersion, decks::immediate_parent_name, decks::{Deck, DeckCommon, DeckId, DeckKindProto, DeckSchema11, DueCounts}, - err::{AnkiError, DbErrorKind, Result}, + error::{AnkiError, DbErrorKind, Result}, i18n::I18n, timestamp::TimestampMillis, }; diff --git a/rslib/src/storage/deckconf/mod.rs b/rslib/src/storage/deckconf/mod.rs index ee952af52..c3310e82e 100644 --- a/rslib/src/storage/deckconf/mod.rs +++ b/rslib/src/storage/deckconf/mod.rs @@ -4,7 +4,7 @@ use super::SqliteStorage; use crate::{ deckconf::{DeckConf, DeckConfId, DeckConfSchema11, DeckConfigInner}, - err::Result, + error::Result, i18n::I18n, }; use prost::Message; diff --git a/rslib/src/storage/graves/mod.rs b/rslib/src/storage/graves/mod.rs index aebcd845c..ee8616562 100644 --- a/rslib/src/storage/graves/mod.rs +++ b/rslib/src/storage/graves/mod.rs @@ -5,7 +5,7 @@ use super::SqliteStorage; use crate::{ card::CardId, decks::DeckId, - err::{AnkiError, Result}, + error::{AnkiError, Result}, notes::NoteId, sync::Graves, types::Usn, diff --git a/rslib/src/storage/note/mod.rs b/rslib/src/storage/note/mod.rs index d499cf36e..14ce6bf15 100644 --- a/rslib/src/storage/note/mod.rs +++ b/rslib/src/storage/note/mod.rs @@ -4,7 +4,7 @@ use std::collections::HashSet; use crate::{ - err::Result, + error::Result, notes::{Note, NoteId, NoteTags}, notetype::NotetypeId, tags::{join_tags, split_tags}, diff --git a/rslib/src/storage/notetype/mod.rs b/rslib/src/storage/notetype/mod.rs index 11d1fc0b5..476388942 100644 --- a/rslib/src/storage/notetype/mod.rs +++ b/rslib/src/storage/notetype/mod.rs @@ -3,7 +3,7 @@ use super::{ids_to_string, SqliteStorage}; use crate::{ - err::{AnkiError, DbErrorKind, Result}, + error::{AnkiError, DbErrorKind, Result}, notes::NoteId, notetype::{ AlreadyGeneratedCardInfo, CardTemplate, CardTemplateConfig, NoteField, NoteFieldConfig, diff --git a/rslib/src/storage/revlog/mod.rs b/rslib/src/storage/revlog/mod.rs index 4d403d9a5..67cf1861c 100644 --- a/rslib/src/storage/revlog/mod.rs +++ b/rslib/src/storage/revlog/mod.rs @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use super::SqliteStorage; -use crate::err::Result; +use crate::error::Result; use crate::{ backend_proto as pb, prelude::*, diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index 201d63fc3..62457bdec 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -2,8 +2,8 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use crate::config::schema11::schema11_config_as_string; -use crate::err::Result; -use crate::err::{AnkiError, DbErrorKind}; +use crate::error::Result; +use crate::error::{AnkiError, DbErrorKind}; use crate::timestamp::{TimestampMillis, TimestampSecs}; use crate::{i18n::I18n, scheduler::timing::v1_creation_date, text::without_combining}; use regex::Regex; diff --git a/rslib/src/storage/sync_check.rs b/rslib/src/storage/sync_check.rs index 80afc3ec4..add63301c 100644 --- a/rslib/src/storage/sync_check.rs +++ b/rslib/src/storage/sync_check.rs @@ -3,7 +3,7 @@ use super::*; use crate::{ - err::SyncErrorKind, + error::SyncErrorKind, prelude::*, sync::{SanityCheckCounts, SanityCheckDueCounts}, }; diff --git a/rslib/src/storage/tag/mod.rs b/rslib/src/storage/tag/mod.rs index a84531c56..32e25a0b3 100644 --- a/rslib/src/storage/tag/mod.rs +++ b/rslib/src/storage/tag/mod.rs @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use super::SqliteStorage; -use crate::{err::Result, tags::Tag, types::Usn}; +use crate::{error::Result, tags::Tag, types::Usn}; use rusqlite::{params, Row, NO_PARAMS}; use std::collections::HashMap; diff --git a/rslib/src/storage/upgrades/mod.rs b/rslib/src/storage/upgrades/mod.rs index 6e9fe5b82..a628738cc 100644 --- a/rslib/src/storage/upgrades/mod.rs +++ b/rslib/src/storage/upgrades/mod.rs @@ -9,7 +9,7 @@ pub(super) const SCHEMA_STARTING_VERSION: u8 = 11; pub(super) const SCHEMA_MAX_VERSION: u8 = 18; use super::SqliteStorage; -use crate::err::Result; +use crate::error::Result; impl SqliteStorage { pub(super) fn upgrade_to_latest_schema(&self, ver: u8, server: bool) -> Result<()> { diff --git a/rslib/src/sync/http_client.rs b/rslib/src/sync/http_client.rs index 212d60f70..3e7aa135b 100644 --- a/rslib/src/sync/http_client.rs +++ b/rslib/src/sync/http_client.rs @@ -6,7 +6,7 @@ use super::{ Chunk, FullSyncProgress, Graves, SanityCheckCounts, SanityCheckOut, SyncMeta, UnchunkedChanges, }; use crate::prelude::*; -use crate::{err::SyncErrorKind, notes::guid, version::sync_client_version}; +use crate::{error::SyncErrorKind, notes::guid, version::sync_client_version}; use async_trait::async_trait; use bytes::Bytes; use flate2::write::GzEncoder; @@ -349,7 +349,7 @@ fn sync_endpoint(host_number: u32) -> String { #[cfg(test)] mod test { use super::*; - use crate::{err::SyncErrorKind, sync::SanityCheckDueCounts}; + use crate::{error::SyncErrorKind, sync::SanityCheckDueCounts}; use tokio::runtime::Runtime; async fn http_client_inner(username: String, password: String) -> Result<()> { diff --git a/rslib/src/sync/mod.rs b/rslib/src/sync/mod.rs index 1b4a911ab..5ab7c6276 100644 --- a/rslib/src/sync/mod.rs +++ b/rslib/src/sync/mod.rs @@ -10,7 +10,7 @@ use crate::{ card::{Card, CardQueue, CardType}, deckconf::DeckConfSchema11, decks::DeckSchema11, - err::SyncErrorKind, + error::SyncErrorKind, notes::Note, notetype::{Notetype, NotetypeSchema11}, prelude::*, diff --git a/rslib/src/template.rs b/rslib/src/template.rs index 21618e9d9..7b1ae0dca 100644 --- a/rslib/src/template.rs +++ b/rslib/src/template.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::err::{AnkiError, Result, TemplateError}; +use crate::error::{AnkiError, Result, TemplateError}; use crate::i18n::I18n; use crate::{cloze::add_cloze_numbers_in_string, template_filters::apply_filters}; use lazy_static::lazy_static; @@ -793,7 +793,7 @@ fn find_fields_with_filter<'a>( #[cfg(test)] mod test { use super::{FieldMap, ParsedNode::*, ParsedTemplate as PT}; - use crate::err::TemplateError; + use crate::error::TemplateError; use crate::{ i18n::I18n, template::{field_is_empty, nonempty_fields, FieldRequirements, RenderContext},