Pass some lints

This commit is contained in:
Daniel Pechersky 2025-09-16 16:31:05 +07:00
parent 46d291bd24
commit 2eab86a633
No known key found for this signature in database
2 changed files with 14 additions and 52 deletions

View file

@ -63,10 +63,7 @@ bitflags = "2.9.1"
blake3 = "1.8.2" blake3 = "1.8.2"
bytes = "1.10.1" bytes = "1.10.1"
camino = "1.1.10" camino = "1.1.10"
chrono = { version = "0.4.41", default-features = false, features = [ chrono = { version = "0.4.41", default-features = false, features = ["std", "clock"] }
"std",
"clock",
] }
clap = { version = "4.5.40", features = ["derive"] } clap = { version = "4.5.40", features = ["derive"] }
coarsetime = "0.1.36" coarsetime = "0.1.36"
convert_case = "0.8.0" convert_case = "0.8.0"
@ -111,26 +108,12 @@ prost-build = "0.13"
prost-reflect = "0.14.7" prost-reflect = "0.14.7"
prost-types = "0.13" prost-types = "0.13"
pulldown-cmark = "0.13.0" pulldown-cmark = "0.13.0"
pyo3 = { version = "0.25.1", features = [ pyo3 = { version = "0.25.1", features = ["extension-module", "abi3", "abi3-py39"] }
"extension-module",
"abi3",
"abi3-py39",
] }
rand = "0.9.1" rand = "0.9.1"
rayon = "1.10.0" rayon = "1.10.0"
regex = "1.11.1" regex = "1.11.1"
reqwest = { version = "0.12.20", default-features = false, features = [ reqwest = { version = "0.12.20", default-features = false, features = ["json", "socks", "stream", "multipart"] }
"json", rusqlite = { version = "0.36.0", features = ["trace", "functions", "collation", "bundled"] }
"socks",
"stream",
"multipart",
] }
rusqlite = { version = "0.36.0", features = [
"trace",
"functions",
"collation",
"bundled",
] }
rustls-pemfile = "2.2.0" rustls-pemfile = "2.2.0"
scopeguard = "1.2.0" scopeguard = "1.2.0"
serde = { version = "1.0.219", features = ["derive"] } serde = { version = "1.0.219", features = ["derive"] }
@ -146,18 +129,10 @@ syn = { version = "2.0.103", features = ["parsing", "printing"] }
tar = "0.4.44" tar = "0.4.44"
tempfile = "3.20.0" tempfile = "3.20.0"
termcolor = "1.4.1" termcolor = "1.4.1"
tokio = { version = "1.45", features = [ tokio = { version = "1.45", features = ["fs", "rt-multi-thread", "macros", "signal"] }
"fs",
"rt-multi-thread",
"macros",
"signal",
] }
tokio-util = { version = "0.7.15", features = ["io"] } tokio-util = { version = "0.7.15", features = ["io"] }
tower-http = { version = "0.6.6", features = ["trace"] } tower-http = { version = "0.6.6", features = ["trace"] }
tracing = { version = "0.1.41", features = [ tracing = { version = "0.1.41", features = ["max_level_trace", "release_max_level_debug"] }
"max_level_trace",
"release_max_level_debug",
] }
tracing-appender = "0.2.3" tracing-appender = "0.2.3"
tracing-subscriber = { version = "0.3.20", features = ["fmt", "env-filter"] } tracing-subscriber = { version = "0.3.20", features = ["fmt", "env-filter"] }
unic-langid = { version = "0.9.6", features = ["macros"] } unic-langid = { version = "0.9.6", features = ["macros"] }
@ -167,24 +142,10 @@ walkdir = "2.5.0"
which = "8.0.0" which = "8.0.0"
widestring = "1.1.0" widestring = "1.1.0"
winapi = { version = "0.3", features = ["wincon", "winreg"] } winapi = { version = "0.3", features = ["wincon", "winreg"] }
windows = { version = "0.61.3", features = [ windows = { version = "0.61.3", features = ["Media_SpeechSynthesis", "Media_Core", "Foundation_Collections", "Storage_Streams", "Win32_System_Console", "Win32_System_Registry", "Win32_System_SystemInformation", "Win32_Foundation", "Win32_UI_Shell", "Wdk_System_SystemServices"] }
"Media_SpeechSynthesis",
"Media_Core",
"Foundation_Collections",
"Storage_Streams",
"Win32_System_Console",
"Win32_System_Registry",
"Win32_System_SystemInformation",
"Win32_Foundation",
"Win32_UI_Shell",
"Wdk_System_SystemServices",
] }
wiremock = "0.6.3" wiremock = "0.6.3"
xz2 = "0.1.7" xz2 = "0.1.7"
zip = { version = "4.1.0", default-features = false, features = [ zip = { version = "4.1.0", default-features = false, features = ["deflate", "time"] }
"deflate",
"time",
] }
zstd = { version = "0.13.3", features = ["zstdmt"] } zstd = { version = "0.13.3", features = ["zstdmt"] }
# Apply mild optimizations to our dependencies in dev mode, which among other things # Apply mild optimizations to our dependencies in dev mode, which among other things

View file

@ -9,7 +9,8 @@ use fsrs::MemoryState;
use fsrs::FSRS; use fsrs::FSRS;
use fsrs::FSRS5_DEFAULT_DECAY; use fsrs::FSRS5_DEFAULT_DECAY;
use fsrs::FSRS6_DEFAULT_DECAY; use fsrs::FSRS6_DEFAULT_DECAY;
use itertools::{Either, Itertools}; use itertools::Either;
use itertools::Itertools;
use super::params::ignore_revlogs_before_ms_from_config; use super::params::ignore_revlogs_before_ms_from_config;
use super::rescheduler::Rescheduler; use super::rescheduler::Rescheduler;
@ -309,8 +310,9 @@ impl Collection {
starting_states.push(item.starting_state); starting_states.push(item.starting_state);
} }
// fsrs.memory_state_batch is O(nm) where n is the number of cards and m is the max review count between all items. // fsrs.memory_state_batch is O(nm) where n is the number of cards and m is the
// Therefore we want to pass batches to fsrs.memory_state_batch where the review count is relatively even. // max review count between all items. Therefore we want to pass batches
// to fsrs.memory_state_batch where the review count is relatively even.
let mut p = permutation::sort_unstable_by_key(&fsrs_items, |item| item.reviews.len()); let mut p = permutation::sort_unstable_by_key(&fsrs_items, |item| item.reviews.len());
p.apply_slice_in_place(&mut to_update); p.apply_slice_in_place(&mut to_update);
p.apply_slice_in_place(&mut fsrs_items); p.apply_slice_in_place(&mut fsrs_items);
@ -640,9 +642,8 @@ mod tests {
} }
mod update_memory_state { mod update_memory_state {
use crate::collection::CollectionBuilder;
use super::*; use super::*;
use crate::collection::CollectionBuilder;
#[test] #[test]
fn smoke() { fn smoke() {