From f488baba1433713148e38044a378f9f26489adf4 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Mon, 9 Mar 2026 18:22:33 -0700 Subject: [PATCH 1/2] Update to trane v0.27.0 --- Cargo.lock | 638 +------------------------------------- Cargo.toml | 8 +- src/app.rs | 57 +--- src/cli.rs | 9 - src/display.rs | 19 ++ src/repository_manager.rs | 6 +- 6 files changed, 54 insertions(+), 683 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e24ac88..b1f67b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,12 +23,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -94,38 +88,12 @@ version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" -[[package]] -name = "arc-swap" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f3647c145568cec02c42054e07bdf9a5a698e15b466fb2341bfc393cd24aa5" -dependencies = [ - "rustversion", -] - -[[package]] -name = "async-trait" -version = "0.1.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "bincode" version = "2.0.1" @@ -152,15 +120,6 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" -[[package]] -name = "bitpacking" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a7139abd3d9cebf8cd6f920a389cf3dc9576172e32f4563f188cae3c3eb019" -dependencies = [ - "crunchy", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -170,31 +129,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bon" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d13a61f2963b88eef9c1be03df65d42f6996dfeac1054870d950fcf66686f83" -dependencies = [ - "bon-macros", - "rustversion", -] - -[[package]] -name = "bon-macros" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d314cc62af2b6b0c65780555abb4d02a03dd3b799cd42419044f0c38d99738c0" -dependencies = [ - "darling 0.23.0", - "ident_case", - "prettyplease", - "proc-macro2", - "quote", - "rustversion", - "syn", -] - [[package]] name = "built" version = "0.8.0" @@ -244,12 +178,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "census" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" - [[package]] name = "cfg-if" version = "1.0.4" @@ -364,15 +292,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - [[package]] name = "crokey" version = "1.4.0" @@ -482,12 +401,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - [[package]] name = "crypto-common" version = "0.1.7" @@ -504,18 +417,8 @@ version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core 0.23.0", - "darling_macro 0.23.0", + "darling_core", + "darling_macro", ] [[package]] @@ -532,51 +435,17 @@ dependencies = [ "syn", ] -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - [[package]] name = "darling_macro" version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.20.11", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core 0.23.0", + "darling_core", "quote", "syn", ] -[[package]] -name = "deranged" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc3dc5ad92c2e2d1c193bbbbdf2ea477cb81331de4f3103f267ca18368b988c4" -dependencies = [ - "powerfmt", - "serde_core", -] - [[package]] name = "derive_builder" version = "0.20.2" @@ -592,7 +461,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ - "darling 0.20.11", + "darling", "proc-macro2", "quote", "syn", @@ -660,12 +529,6 @@ dependencies = [ "litrs", ] -[[package]] -name = "downcast-rs" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" - [[package]] name = "either" version = "1.15.0" @@ -712,12 +575,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" -[[package]] -name = "fastdivide" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afc2bd4d5a73106dd53d10d73d3401c2f32730ba2c0b93ddb888a8983680471" - [[package]] name = "fastrand" version = "2.3.0" @@ -768,58 +625,12 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs4" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4" -dependencies = [ - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "fs_extra" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-macro" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-core", - "futures-macro", - "futures-task", - "pin-project-lite", - "slab", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -830,17 +641,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "getrandom" version = "0.3.4" @@ -887,8 +687,6 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "allocator-api2", - "equivalent", "foldhash", ] @@ -928,21 +726,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "htmlescape" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" - -[[package]] -name = "hyperloglogplus" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "621debdf94dcac33e50475fdd76d34d5ea9c0362a834b9db08c3024696c1fbe3" -dependencies = [ - "serde", -] - [[package]] name = "iana-time-zone" version = "0.1.65" @@ -1108,15 +891,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.17" @@ -1178,12 +952,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" -[[package]] -name = "levenshtein_automata" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25" - [[package]] name = "libc" version = "0.2.182" @@ -1204,12 +972,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libm" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" - [[package]] name = "libsqlite3-sys" version = "0.35.0" @@ -1280,45 +1042,12 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -[[package]] -name = "lru" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" -dependencies = [ - "hashbrown 0.15.5", -] - -[[package]] -name = "lz4_flex" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a" - -[[package]] -name = "measure_time" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51c55d61e72fc3ab704396c5fa16f4c184db37978ae4e94ca8959693a235fc0e" -dependencies = [ - "log", -] - [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" -[[package]] -name = "memmap2" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" -dependencies = [ - "libc", -] - [[package]] name = "minimad" version = "0.13.1" @@ -1328,12 +1057,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "mio" version = "1.1.1" @@ -1346,12 +1069,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "murmurhash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" - [[package]] name = "nibble_vec" version = "0.1.0" @@ -1373,22 +1090,6 @@ dependencies = [ "libc", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-conv" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" - [[package]] name = "num-traits" version = "0.2.19" @@ -1396,7 +1097,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -1411,12 +1111,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" -[[package]] -name = "oneshot" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269bca4c2591a28585d6bf10d9ed0332b7d76900a1b02bec41bdc3a2cdcda107" - [[package]] name = "openssl-probe" version = "0.1.6" @@ -1435,15 +1129,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "ownedbytes" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fbd56f7631767e61784dc43f8580f403f4475bd4aaa4da003e6295e1bab4a7e" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "parking_lot" version = "0.12.5" @@ -1483,12 +1168,6 @@ dependencies = [ "indexmap", ] -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - [[package]] name = "pkg-config" version = "0.3.32" @@ -1504,12 +1183,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.21" @@ -1585,35 +1258,14 @@ dependencies = [ "nibble_vec", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "rand_chacha", + "rand_core", ] [[package]] @@ -1623,16 +1275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.17", + "rand_core", ] [[package]] @@ -1644,16 +1287,6 @@ dependencies = [ "getrandom 0.3.4", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - [[package]] name = "rayon" version = "1.11.0" @@ -1736,22 +1369,6 @@ dependencies = [ "rusqlite", ] -[[package]] -name = "rust-stemmers" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" -dependencies = [ - "serde", - "serde_derive", -] - -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - [[package]] name = "rustc_version" version = "0.4.1" @@ -1947,21 +1564,6 @@ dependencies = [ "libc", ] -[[package]] -name = "sketches-ddsketch" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e9a774a6c28142ac54bb25d25562e6bcf957493a184f15ad4eebccb23e410a" -dependencies = [ - "serde", -] - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - [[package]] name = "smallvec" version = "1.15.1" @@ -2029,152 +1631,6 @@ dependencies = [ "syn", ] -[[package]] -name = "tantivy" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502915c7381c5cb2d2781503962610cb880ad8f1a0ca95df1bae645d5ebf2545" -dependencies = [ - "aho-corasick", - "arc-swap", - "base64", - "bitpacking", - "bon", - "byteorder", - "census", - "crc32fast", - "crossbeam-channel", - "downcast-rs", - "fastdivide", - "fnv", - "fs4", - "htmlescape", - "hyperloglogplus", - "itertools", - "levenshtein_automata", - "log", - "lru", - "lz4_flex", - "measure_time", - "memmap2", - "once_cell", - "oneshot", - "rayon", - "regex", - "rust-stemmers", - "rustc-hash", - "serde", - "serde_json", - "sketches-ddsketch", - "smallvec", - "tantivy-bitpacker", - "tantivy-columnar", - "tantivy-common", - "tantivy-fst", - "tantivy-query-grammar", - "tantivy-stacker", - "tantivy-tokenizer-api", - "tempfile", - "thiserror", - "time", - "uuid", - "winapi", -] - -[[package]] -name = "tantivy-bitpacker" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b04eed5108d8283607da6710fe17a7663523440eaf7ea5a1a440d19a1448b6" -dependencies = [ - "bitpacking", -] - -[[package]] -name = "tantivy-columnar" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b628488ae936c83e92b5c4056833054ca56f76c0e616aee8339e24ac89119cd" -dependencies = [ - "downcast-rs", - "fastdivide", - "itertools", - "serde", - "tantivy-bitpacker", - "tantivy-common", - "tantivy-sstable", - "tantivy-stacker", -] - -[[package]] -name = "tantivy-common" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f880aa7cab0c063a47b62596d10991cdd0b6e0e0575d9c5eeb298b307a25de55" -dependencies = [ - "async-trait", - "byteorder", - "ownedbytes", - "serde", - "time", -] - -[[package]] -name = "tantivy-fst" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18" -dependencies = [ - "byteorder", - "regex-syntax", - "utf8-ranges", -] - -[[package]] -name = "tantivy-query-grammar" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "768fccdc84d60d86235d42d7e4c33acf43c418258ff5952abf07bd7837fcd26b" -dependencies = [ - "nom", - "serde", - "serde_json", -] - -[[package]] -name = "tantivy-sstable" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8292095d1a8a2c2b36380ec455f910ab52dde516af36321af332c93f20ab7d5" -dependencies = [ - "futures-util", - "itertools", - "tantivy-bitpacker", - "tantivy-common", - "tantivy-fst", - "zstd", -] - -[[package]] -name = "tantivy-stacker" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d38a379411169f0b3002c9cba61cdfe315f757e9d4f239c00c282497a0749d" -dependencies = [ - "murmurhash32", - "rand_distr", - "tantivy-common", -] - -[[package]] -name = "tantivy-tokenizer-api" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23024f6aeb25ceb1a0e27740c84bdb0fae52626737b7e9a9de6ad5aa25c7b038" -dependencies = [ - "serde", -] - [[package]] name = "tempfile" version = "3.25.0" @@ -2224,37 +1680,6 @@ dependencies = [ "syn", ] -[[package]] -name = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "time-macros" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tinystr" version = "0.8.2" @@ -2308,9 +1733,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "trane" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7e32534c8dea800559b774383547683caef11a9487bad4426c446a9eae6aa8" +checksum = "9518599d7cd88858b0226ab5a6501c7bf22e6309f5fa5bd99d4564c3be7d056a" dependencies = [ "anyhow", "bincode", @@ -2320,15 +1745,13 @@ dependencies = [ "parking_lot", "r2d2", "r2d2_sqlite", - "rand 0.9.2", + "rand", "rayon", "rusqlite", "rusqlite_migration", "serde", "serde_json", "strum", - "tantivy", - "tempfile", "thiserror", "ustr", "walkdir", @@ -2336,7 +1759,7 @@ dependencies = [ [[package]] name = "trane-cli" -version = "0.26.0" +version = "0.27.0" dependencies = [ "anyhow", "built", @@ -2346,7 +1769,7 @@ dependencies = [ "git2", "hex", "indoc", - "rand 0.9.2", + "rand", "rustyline", "rustyline-derive", "serde", @@ -2426,12 +1849,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf8-ranges" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -2452,8 +1869,7 @@ checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" dependencies = [ "getrandom 0.4.1", "js-sys", - "rand 0.9.2", - "serde_core", + "rand", "wasm-bindgen", ] @@ -3039,31 +2455,3 @@ name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" - -[[package]] -name = "zstd" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index 52b1fff..60efe9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "trane-cli" -version = "0.26.0" +version = "0.27.0" build = "build.rs" default-run = "trane" @@ -29,11 +29,11 @@ rustyline-derive = "0.11.1" tempfile = "3.21.0" serde_json = "1.0.143" termimad = "0.33.0" -trane = "0.26.0" -ustr = { version = "1.1.0", features = ["serde"] } -url = "2.5.7" +trane = "0.27.0" # Commented out for use in local development. # trane = { path = "../trane" } +ustr = { version = "1.1.0", features = ["serde"] } +url = "2.5.7" [build-dependencies] built = { version = "0.8.0", features = ["chrono", "dependency-tree", "git2", "semver"] } diff --git a/src/app.rs b/src/app.rs index 91b7da7..8ac2f89 100644 --- a/src/app.rs +++ b/src/app.rs @@ -572,7 +572,7 @@ impl TraneApp { Some(manifest) => match filter { UnitFilter::CourseFilter { .. } => filter.passes_course_filter(course_id), UnitFilter::LessonFilter { .. } => false, - UnitFilter::MetadataFilter { filter } => filter.apply_to_course(&manifest), + UnitFilter::MetadataFilter { filter } => filter.apply_to_course(manifest.as_ref()), UnitFilter::Dependents { unit_ids } | UnitFilter::Dependencies { unit_ids, .. } => unit_ids.contains(course_id), UnitFilter::ReviewListFilter => { @@ -638,7 +638,7 @@ impl TraneApp { return true; } let course_manifest = course_manifest.unwrap(); - filter.apply_to_lesson(&course_manifest, &lesson_manifest) + filter.apply_to_lesson(course_manifest.as_ref(), lesson_manifest.as_ref()) } UnitFilter::ReviewListFilter => { if let Ok(review_units) = @@ -751,7 +751,7 @@ impl TraneApp { .unwrap() .get_filter(filter_id) .ok_or_else(|| anyhow!("no filter with ID {filter_id}"))?; - self.filter = Some(saved_filter.filter); + self.filter = Some(saved_filter.filter.clone()); self.study_session = None; self.reset_batch(); Ok(()) @@ -810,7 +810,7 @@ impl TraneApp { .unwrap() .get_course_manifest(course_id) .ok_or_else(|| anyhow!("no manifest for course with ID {course_id}"))?; - match manifest.course_instructions { + match &manifest.course_instructions { None => { println!("Course has no instructions"); Ok(()) @@ -830,7 +830,7 @@ impl TraneApp { .unwrap() .get_lesson_manifest(lesson_id) .ok_or_else(|| anyhow!("no manifest for lesson with ID {lesson_id}"))?; - match manifest.lesson_instructions { + match &manifest.lesson_instructions { None => { println!("Lesson has no instructions"); Ok(()) @@ -850,7 +850,7 @@ impl TraneApp { .unwrap() .get_course_manifest(course_id) .ok_or_else(|| anyhow!("no manifest for course with ID {course_id}"))?; - match manifest.course_material { + match &manifest.course_material { None => { println!("Course has no material"); Ok(()) @@ -870,7 +870,7 @@ impl TraneApp { .unwrap() .get_lesson_manifest(lesson_id) .ok_or_else(|| anyhow!("no manifest for lesson with ID {lesson_id}"))?; - match manifest.lesson_material { + match &manifest.lesson_material { None => { println!("Lesson has no material"); Ok(()) @@ -912,7 +912,8 @@ impl TraneApp { .unwrap() .get_exercise_manifest(exercise_id) .ok_or_else(|| anyhow!("no manifest for exercise with ID {exercise_id}"))? - .exercise_type; + .exercise_type + .clone(); // Retrieve the scores and rewards and compute the aggregate score. let previous_trials = self @@ -1169,37 +1170,6 @@ impl TraneApp { Ok(()) } - /// Searches for units which match the given query. - pub fn search(&self, terms: &[String]) -> Result<()> { - ensure!(self.trane.is_some(), "no Trane instance is open"); - ensure!(!terms.is_empty(), "no search terms given"); - - let query = terms - .iter() - .map(|s| { - let mut quoted = "\"".to_string(); - quoted.push_str(s); - quoted.push('"'); - quoted - }) - .collect::>() - .join(" "); - let results = self.trane.as_ref().unwrap().search(&query)?; - - if results.is_empty() { - println!("No results found"); - return Ok(()); - } - - println!("Search results:"); - println!("{:<10} {:<50}", "Unit Type", "Unit ID"); - for unit_id in results { - let unit_type = self.get_unit_type(unit_id)?; - println!("{unit_type:<10} {unit_id:<50}"); - } - Ok(()) - } - /// Resets the scheduler options to their default values. pub fn reset_scheduler_options(&mut self) -> Result<()> { ensure!(self.trane.is_some(), "no Trane instance is open"); @@ -1286,7 +1256,8 @@ impl TraneApp { return Ok(()); }; let exercise_id = self.exercise_id_or_current(exercise_id)?; - let get_exercise_manifest = |exercise_id| trane.get_exercise_manifest(exercise_id); + let get_exercise_manifest = + |exercise_id| trane.get_exercise_manifest(exercise_id).map(|m| m.as_ref().clone()); let path = downloader.transcription_download_path(exercise_id, &get_exercise_manifest); if let Some(path) = path { @@ -1310,7 +1281,8 @@ impl TraneApp { return Ok(()); }; let exercise_id = self.exercise_id_or_current(exercise_id)?; - let get_exercise_manifest = |exercise_id| trane.get_exercise_manifest(exercise_id); + let get_exercise_manifest = + |exercise_id| trane.get_exercise_manifest(exercise_id).map(|m| m.as_ref().clone()); downloader.download_transcription_asset(exercise_id, redownload, &get_exercise_manifest)?; println!("Transcription asset for exercise {exercise_id} downloaded"); @@ -1325,7 +1297,8 @@ impl TraneApp { return Ok(()); }; let exercise_id = self.exercise_id_or_current(exercise_id)?; - let get_exercise_manifest = |exercise_id| trane.get_exercise_manifest(exercise_id); + let get_exercise_manifest = + |exercise_id| trane.get_exercise_manifest(exercise_id).map(|m| m.as_ref().clone()); let is_downloaded = downloader.is_transcription_asset_downloaded(exercise_id, &get_exercise_manifest); diff --git a/src/cli.rs b/src/cli.rs index cbffc5c..e05133b 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -460,11 +460,6 @@ pub(crate) enum Subcommands { score: u8, }, - #[clap(about = "Search for courses, lessons, and exercises")] - Search { - #[clap(help = "The search query")] - terms: Vec, - }, #[clap(about = "Show the most recent scores for the given exercise")] Scores { @@ -765,10 +760,6 @@ impl TraneCli { } }, - Subcommands::Search { terms } => { - app.search(&terms)?; - Ok(true) - } Subcommands::Score { score } => { app.record_score(score)?; diff --git a/src/display.rs b/src/display.rs index 5970a9e..96f9756 100644 --- a/src/display.rs +++ b/src/display.rs @@ -115,6 +115,11 @@ impl DisplayExercise for ExerciseAsset { println!(); Ok(()) } + ExerciseAsset::InlineFlashcardAsset { front_content, .. } => { + print_inline(front_content); + println!(); + Ok(()) + } } } } @@ -159,6 +164,20 @@ impl DisplayAnswer for ExerciseAsset { } } ExerciseAsset::SoundSliceAsset { .. } | ExerciseAsset::LiteracyAsset { .. } => Ok(()), + ExerciseAsset::InlineFlashcardAsset { + back_content, .. + } => { + if let Some(back_content) = back_content { + println!("Answer:"); + println!(); + print_inline(back_content); + println!(); + Ok(()) + } else { + println!("No answer available for this exercise."); + Ok(()) + } + } } } } diff --git a/src/repository_manager.rs b/src/repository_manager.rs index ac468a9..5bc0c59 100644 --- a/src/repository_manager.rs +++ b/src/repository_manager.rs @@ -273,8 +273,8 @@ mod test { use super::*; - const REPO_URL: &str = "https://github.com/trane-project/trane-leetcode.git"; - const REPO_ID: &str = "trane-leetcode"; + const REPO_URL: &str = "https://github.com/trane-project/trane-music.git"; + const REPO_ID: &str = "trane-music"; fn setup_directories(library_root: &Path) -> Result<()> { let metadata_dir = library_root @@ -343,7 +343,7 @@ mod test { setup_directories(library_root.path())?; let mut manager = LocalRepositoryManager::new(library_root.path())?; assert!(manager - .add_repo("git@github.com:trane-project/trane-leetcode.git", None) + .add_repo("git@github.com:trane-project/trane-music.git", None) .is_err()); Ok(()) } From 088f49a877561408a9cb2332190eaddde21a1d56 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Mon, 9 Mar 2026 18:24:52 -0700 Subject: [PATCH 2/2] cargo fmt --- src/app.rs | 28 ++++++++++++++++++++-------- src/cli.rs | 2 -- src/display.rs | 4 +--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/app.rs b/src/app.rs index 8ac2f89..3e82b22 100644 --- a/src/app.rs +++ b/src/app.rs @@ -572,7 +572,9 @@ impl TraneApp { Some(manifest) => match filter { UnitFilter::CourseFilter { .. } => filter.passes_course_filter(course_id), UnitFilter::LessonFilter { .. } => false, - UnitFilter::MetadataFilter { filter } => filter.apply_to_course(manifest.as_ref()), + UnitFilter::MetadataFilter { filter } => { + filter.apply_to_course(manifest.as_ref()) + } UnitFilter::Dependents { unit_ids } | UnitFilter::Dependencies { unit_ids, .. } => unit_ids.contains(course_id), UnitFilter::ReviewListFilter => { @@ -638,7 +640,8 @@ impl TraneApp { return true; } let course_manifest = course_manifest.unwrap(); - filter.apply_to_lesson(course_manifest.as_ref(), lesson_manifest.as_ref()) + filter + .apply_to_lesson(course_manifest.as_ref(), lesson_manifest.as_ref()) } UnitFilter::ReviewListFilter => { if let Ok(review_units) = @@ -1256,8 +1259,11 @@ impl TraneApp { return Ok(()); }; let exercise_id = self.exercise_id_or_current(exercise_id)?; - let get_exercise_manifest = - |exercise_id| trane.get_exercise_manifest(exercise_id).map(|m| m.as_ref().clone()); + let get_exercise_manifest = |exercise_id| { + trane + .get_exercise_manifest(exercise_id) + .map(|m| m.as_ref().clone()) + }; let path = downloader.transcription_download_path(exercise_id, &get_exercise_manifest); if let Some(path) = path { @@ -1281,8 +1287,11 @@ impl TraneApp { return Ok(()); }; let exercise_id = self.exercise_id_or_current(exercise_id)?; - let get_exercise_manifest = - |exercise_id| trane.get_exercise_manifest(exercise_id).map(|m| m.as_ref().clone()); + let get_exercise_manifest = |exercise_id| { + trane + .get_exercise_manifest(exercise_id) + .map(|m| m.as_ref().clone()) + }; downloader.download_transcription_asset(exercise_id, redownload, &get_exercise_manifest)?; println!("Transcription asset for exercise {exercise_id} downloaded"); @@ -1297,8 +1306,11 @@ impl TraneApp { return Ok(()); }; let exercise_id = self.exercise_id_or_current(exercise_id)?; - let get_exercise_manifest = - |exercise_id| trane.get_exercise_manifest(exercise_id).map(|m| m.as_ref().clone()); + let get_exercise_manifest = |exercise_id| { + trane + .get_exercise_manifest(exercise_id) + .map(|m| m.as_ref().clone()) + }; let is_downloaded = downloader.is_transcription_asset_downloaded(exercise_id, &get_exercise_manifest); diff --git a/src/cli.rs b/src/cli.rs index e05133b..b6b802a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -460,7 +460,6 @@ pub(crate) enum Subcommands { score: u8, }, - #[clap(about = "Show the most recent scores for the given exercise")] Scores { #[clap(help = "The ID of the exercise")] @@ -760,7 +759,6 @@ impl TraneCli { } }, - Subcommands::Score { score } => { app.record_score(score)?; println!("Recorded mastery score {score} for current exercise."); diff --git a/src/display.rs b/src/display.rs index 96f9756..24dc224 100644 --- a/src/display.rs +++ b/src/display.rs @@ -164,9 +164,7 @@ impl DisplayAnswer for ExerciseAsset { } } ExerciseAsset::SoundSliceAsset { .. } | ExerciseAsset::LiteracyAsset { .. } => Ok(()), - ExerciseAsset::InlineFlashcardAsset { - back_content, .. - } => { + ExerciseAsset::InlineFlashcardAsset { back_content, .. } => { if let Some(back_content) = back_content { println!("Answer:"); println!();