From 3d212aad0e0c08bb3bc1cbd7498576fe66e06091 Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Thu, 26 Dec 2024 21:59:40 -0700 Subject: [PATCH 1/3] Clippy fixes --- src/communication/input.rs | 10 ++-------- src/communication/reader.rs | 6 +----- src/extensions/parser.rs | 16 ++++++++-------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/communication/input.rs b/src/communication/input.rs index f9e93697..6718b2f3 100644 --- a/src/communication/input.rs +++ b/src/communication/input.rs @@ -37,8 +37,6 @@ use tokio::{ pub struct InputStream { pub stdout: Receiver, pub stderr: Receiver, - pub process_name: String, - pub process: Result, std::io::Error>, pub should_die: Arc>, pub _type: String, } @@ -74,7 +72,7 @@ impl Input for FileInput { }; // Start process - let process = thread::Builder::new() + let _ = thread::Builder::new() .name(format!("FileInput: {}", name)) .spawn(move || { // Create a buffer and read from it @@ -94,8 +92,6 @@ impl Input for FileInput { Ok(InputStream { stdout: out_rx, stderr: err_rx, - process_name: name, - process, should_die: Arc::new(Mutex::new(false)), _type: String::from("FileInput"), }) @@ -127,7 +123,7 @@ impl Input for CommandInput { let mut poll_rate = RollingMean::new(5); // Start reading from the queues - let process = thread::Builder::new() + let _ = thread::Builder::new() .name(format!("CommandInput: {}", name)) .spawn(move || { let runtime = Runtime::new().unwrap(); @@ -186,8 +182,6 @@ impl Input for CommandInput { Ok(InputStream { stdout: out_rx, stderr: err_rx, - process_name: name, - process, should_die, _type: String::from("CommandInput"), }) diff --git a/src/communication/reader.rs b/src/communication/reader.rs index 35de3099..918065ad 100644 --- a/src/communication/reader.rs +++ b/src/communication/reader.rs @@ -19,7 +19,6 @@ use crate::{ handlers::{ command::CommandHandler, handler::Handler, - multiple_choice::MultipleChoiceHandler, normal::NormalHandler, parser::{ParserHandler, ParserState}, processor::ProcessorMethods, @@ -125,8 +124,6 @@ pub struct MainWindow { pub config: LogriaConfig, pub input_type: InputType, pub previous_input_type: InputType, - // pub output: Stdout, - pub mc_handler: MultipleChoiceHandler, length_finder: LengthFinder, } @@ -201,7 +198,6 @@ impl MainWindow { input_type: InputType::Startup, previous_input_type: InputType::Startup, length_finder: LengthFinder::new(), - mc_handler: MultipleChoiceHandler::new(), config: LogriaConfig { poll_rate: DEFAULT, smart_poll_rate, @@ -485,7 +481,7 @@ impl MainWindow { // Get some metadata we need to render the message let message_length = self.length_finder.get_real_length(message); - let message_rows = max(1, ((message_length) + (width - 1)) / width); + let message_rows = max(1, (message_length).div_ceil(width)); // Update the current row, stop writing if there is no more space current_row = match current_row.checked_sub(max(1, message_rows as u16)) { diff --git a/src/extensions/parser.rs b/src/extensions/parser.rs index f2e47b51..4f0f35e6 100644 --- a/src/extensions/parser.rs +++ b/src/extensions/parser.rs @@ -623,7 +623,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -641,7 +641,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -661,7 +661,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -676,7 +676,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -691,7 +691,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -706,7 +706,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -721,7 +721,7 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } #[test] @@ -736,6 +736,6 @@ mod aggregate_tests { map, ); parser.setup(); - assert!(parser.aggregator_map.get("1").is_some()); + assert!(parser.aggregator_map.contains_key("1")); } } From a1c807cfd14209d07fe37c66c4bc5a99c4a0a48c Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Thu, 26 Dec 2024 22:07:03 -0700 Subject: [PATCH 2/3] Bump deps --- Cargo.lock | 496 +++++++++++++++++++++++++++++++++++++++-------------- Cargo.toml | 22 +-- 2 files changed, 376 insertions(+), 142 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b669dc0a..ce7b3f33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,25 +1,78 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] -name = "atty" -version = "0.2.14" +name = "anstream" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ - "hermit-abi", - "libc", - "winapi", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +dependencies = [ + "anstyle", + "windows-sys 0.59.0", ] [[package]] @@ -28,6 +81,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -48,26 +116,36 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.0.10" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1a0a4208c6c483b952ad35c6eed505fc13b46f08f631b81e828084a9318d74" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ - "atty", - "bitflags", + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "once_cell", "strsim", - "termcolor", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "crossterm" @@ -78,7 +156,7 @@ dependencies = [ "bitflags", "crossterm_winapi", "libc", - "mio", + "mio 0.8.4", "parking_lot", "signal-hook", "signal-hook-mio", @@ -87,31 +165,41 @@ dependencies = [ [[package]] name = "crossterm_winapi" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" dependencies = [ "winapi", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "dirs" -version = "4.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -135,23 +223,26 @@ dependencies = [ ] [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "gimli" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "is_executable" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +checksum = "d4a1b5bad6f9072935961dfbf1cced2f3d129963d091b6f69f007fe04e758ae2" dependencies = [ "winapi", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itoa" version = "1.0.2" @@ -160,9 +251,9 @@ checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "lock_api" @@ -201,9 +292,18 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +dependencies = [ + "adler2", +] [[package]] name = "mio" @@ -218,35 +318,36 @@ dependencies = [ ] [[package]] -name = "num_cpus" -version = "1.13.1" +name = "mio" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", + "wasi", + "windows-sys 0.52.0", ] [[package]] -name = "num_threads" -version = "0.1.6" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "once_cell" -version = "1.13.0" +name = "object" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] [[package]] -name = "os_str_bytes" -version = "6.3.0" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "parking_lot" @@ -273,24 +374,30 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -317,9 +424,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -328,9 +447,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "ryu" @@ -346,40 +471,41 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.140" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.92", ] [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "signal-hook" -version = "0.3.14" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -387,12 +513,12 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio", + "mio 0.8.4", "signal-hook", ] @@ -413,9 +539,9 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -429,12 +555,14 @@ dependencies = [ ] [[package]] -name = "termcolor" -version = "1.1.3" +name = "syn" +version = "2.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "70ae51629bf965c5c098cc9e87908a3df5301051a9e087d6f9bef5c9771ed126" dependencies = [ - "winapi-util", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] @@ -454,47 +582,65 @@ checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] name = "time" -version = "0.3.11" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ + "deranged", "itoa", - "libc", - "num_threads", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +dependencies = [ + "num-conv", + "time-core", ] [[package]] name = "tokio" -version = "1.25.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", - "mio", - "num_cpus", + "mio 1.0.3", "pin-project-lite", "signal-hook-registry", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.92", ] [[package]] @@ -503,6 +649,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -525,15 +677,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -555,24 +698,73 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -582,9 +774,15 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -594,9 +792,21 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -606,9 +816,15 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -618,15 +834,27 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -636,6 +864,12 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/Cargo.toml b/Cargo.toml index 0dc126df..b960e57f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,18 +12,18 @@ repository = "https://github.com/ReagentX/Logria" version = "0.0.0" [dependencies] -clap = {version = "4.0.10", features = ["cargo"]} -crossterm = "0.25.0" -dirs = "4.0.0" -format_num = "0.1.0" -is_executable = "1.0.1" -regex = "1.6.0" -serde = {version = "1.0.139", features = ["derive"]} -serde_json = "1.0.82" -time = {version = "0.3.11", features = ["formatting", "parsing"]} -tokio = {version = "1.25.0", features = [ +clap = { version = "=4.5.23", features = ["cargo"] } +crossterm = "=0.25.0" +dirs = "=5.0.1" +format_num = "=0.1.0" +is_executable = "=1.0.4" +regex = "=1.11.1" +serde = { version = "=1.0.216", features = ["derive"] } +serde_json = "=1.0.134" +time = { version = "=0.3.37", features = ["formatting", "parsing"] } +tokio = { version = "=1.42.0", features = [ "process", "io-util", "rt-multi-thread", "macros", -]} +] } From be3c2930be84f66b5b12a928fa54d23fd29dc98c Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Thu, 26 Dec 2024 22:12:18 -0700 Subject: [PATCH 3/3] Bump crossterm, use std:io::Result --- Cargo.lock | 64 +++++++++++++------ Cargo.toml | 2 +- src/communication/handlers/command.rs | 4 +- src/communication/handlers/handler.rs | 3 +- src/communication/handlers/multiple_choice.rs | 3 +- src/communication/handlers/normal.rs | 4 +- src/communication/handlers/parser.rs | 6 +- src/communication/handlers/processor.rs | 2 +- src/communication/handlers/regex.rs | 4 +- src/communication/handlers/startup.rs | 4 +- src/communication/handlers/user_input.rs | 4 +- src/communication/reader.rs | 3 +- src/main.rs | 2 +- src/ui/interface.rs | 5 +- 14 files changed, 68 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce7b3f33..9977ea66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,6 +102,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "bytes" version = "1.2.0" @@ -149,15 +155,15 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "crossterm" -version = "0.25.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags", + "bitflags 2.6.0", "crossterm_winapi", - "libc", - "mio 0.8.4", + "mio", "parking_lot", + "rustix", "signal-hook", "signal-hook-mio", "winapi", @@ -202,6 +208,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "format_num" version = "0.1.0" @@ -255,6 +271,12 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + [[package]] name = "lock_api" version = "0.4.7" @@ -305,18 +327,6 @@ dependencies = [ "adler2", ] -[[package]] -name = "mio" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.36.1", -] - [[package]] name = "mio" version = "1.0.3" @@ -324,6 +334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", + "log", "wasi", "windows-sys 0.52.0", ] @@ -408,7 +419,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -457,6 +468,19 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustix" +version = "0.38.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + [[package]] name = "ryu" version = "1.0.10" @@ -518,7 +542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio 0.8.4", + "mio", "signal-hook", ] @@ -625,7 +649,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.3", + "mio", "pin-project-lite", "signal-hook-registry", "tokio-macros", diff --git a/Cargo.toml b/Cargo.toml index b960e57f..c86d0eba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ version = "0.0.0" [dependencies] clap = { version = "=4.5.23", features = ["cargo"] } -crossterm = "=0.25.0" +crossterm = "=0.28.1" dirs = "=5.0.1" format_num = "=0.1.0" is_executable = "=1.0.4" diff --git a/src/communication/handlers/command.rs b/src/communication/handlers/command.rs index 9a188b14..aa7ff934 100644 --- a/src/communication/handlers/command.rs +++ b/src/communication/handlers/command.rs @@ -1,6 +1,6 @@ -use std::io::{stdout, Write}; +use std::io::{stdout, Result, Write}; -use crossterm::{event::KeyCode, Result}; +use crossterm::event::KeyCode; use super::handler::Handler; use crate::{ diff --git a/src/communication/handlers/handler.rs b/src/communication/handlers/handler.rs index 90ce4f90..0d92a254 100644 --- a/src/communication/handlers/handler.rs +++ b/src/communication/handlers/handler.rs @@ -1,4 +1,5 @@ -use crossterm::Result; +use std::io::Result; + use crossterm::event::KeyCode; use crate::communication::reader::MainWindow; diff --git a/src/communication/handlers/multiple_choice.rs b/src/communication/handlers/multiple_choice.rs index e62d8673..9c0ae5b2 100644 --- a/src/communication/handlers/multiple_choice.rs +++ b/src/communication/handlers/multiple_choice.rs @@ -1,7 +1,6 @@ -use std::collections::HashMap; +use std::{collections::HashMap, io::Result}; use crossterm::event::KeyCode; -use crossterm::Result; use crate::{ communication::{ diff --git a/src/communication/handlers/normal.rs b/src/communication/handlers/normal.rs index 6b35f786..4aceddf2 100644 --- a/src/communication/handlers/normal.rs +++ b/src/communication/handlers/normal.rs @@ -1,6 +1,6 @@ -use std::io::stdout; +use std::io::{stdout, Result}; -use crossterm::{cursor, event::KeyCode, queue, Result}; +use crossterm::{cursor, event::KeyCode, queue}; use super::handler::Handler; use crate::{ diff --git a/src/communication/handlers/parser.rs b/src/communication/handlers/parser.rs index 6acdcbbf..c425e30b 100644 --- a/src/communication/handlers/parser.rs +++ b/src/communication/handlers/parser.rs @@ -1,6 +1,6 @@ -use std::path::Path; +use std::{io::Result, path::Path}; -use crossterm::{event::KeyCode, Result}; +use crossterm::event::KeyCode; use regex::Regex; use crate::{ @@ -279,7 +279,7 @@ impl Handler for ParserHandler { } } - fn receive_input(&mut self, window: &mut MainWindow, key: KeyCode) -> crossterm::Result<()> { + fn receive_input(&mut self, window: &mut MainWindow, key: KeyCode) -> Result<()> { // Enable command mode for parsers if key == KeyCode::Char(':') { window.set_command_mode(Some(Parser::del))?; diff --git a/src/communication/handlers/processor.rs b/src/communication/handlers/processor.rs index 3121114c..b999443a 100644 --- a/src/communication/handlers/processor.rs +++ b/src/communication/handlers/processor.rs @@ -1,4 +1,4 @@ -use crossterm::Result; +use std::io::Result; use crate::communication::reader::MainWindow; diff --git a/src/communication/handlers/regex.rs b/src/communication/handlers/regex.rs index 68a7f5a9..d4626aaf 100644 --- a/src/communication/handlers/regex.rs +++ b/src/communication/handlers/regex.rs @@ -1,4 +1,6 @@ -use crossterm::{event::KeyCode, Result}; +use std::io::Result; + +use crossterm::event::KeyCode; use regex::bytes::Regex; use super::{handler::Handler, processor::ProcessorMethods}; diff --git a/src/communication/handlers/startup.rs b/src/communication/handlers/startup.rs index fa162ed8..15d4cc42 100644 --- a/src/communication/handlers/startup.rs +++ b/src/communication/handlers/startup.rs @@ -1,6 +1,6 @@ -use std::collections::HashMap; +use std::{collections::HashMap, io::Result}; -use crossterm::{event::KeyCode, Result}; +use crossterm::event::KeyCode; use super::{handler::Handler, user_input::UserInputHandler}; use crate::{ diff --git a/src/communication/handlers/user_input.rs b/src/communication/handlers/user_input.rs index 34f2e0f4..5d78062b 100644 --- a/src/communication/handlers/user_input.rs +++ b/src/communication/handlers/user_input.rs @@ -1,9 +1,9 @@ use std::{ cmp::{max, min}, - io::{stdout, Write}, + io::{stdout, Write, Result}, }; -use crossterm::{cursor, event::KeyCode, queue, style, terminal::size, Result}; +use crossterm::{cursor, event::KeyCode, queue, style, terminal::size}; use crate::{ communication::{handlers::handler::Handler, reader::MainWindow}, diff --git a/src/communication/reader.rs b/src/communication/reader.rs index 918065ad..986faaa9 100644 --- a/src/communication/reader.rs +++ b/src/communication/reader.rs @@ -1,6 +1,6 @@ use std::{ cmp::max, - io::{stdout, Write}, + io::{stdout, Result, Write}, panic, time::{Duration, Instant}, }; @@ -10,7 +10,6 @@ use crossterm::{ event::{poll, read, Event, KeyCode, KeyEvent, KeyEventKind, KeyEventState, KeyModifiers}, execute, queue, style, terminal::{disable_raw_mode, size, Clear, ClearType}, - Result, }; use regex::bytes::Regex; diff --git a/src/main.rs b/src/main.rs index b0d366e6..83c76e4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ #![forbid(unsafe_code)] -use crossterm::Result; +use std::io::Result; mod communication; mod constants; diff --git a/src/ui/interface.rs b/src/ui/interface.rs index c0aa95b3..452436f1 100644 --- a/src/ui/interface.rs +++ b/src/ui/interface.rs @@ -1,5 +1,6 @@ -use crossterm::{cursor, execute, queue, style, terminal, tty::IsTty, Result}; -use std::io::{stdin, stdout, Stdout, Write}; +use std::io::{stdin, stdout, Result, Stdout, Write}; + +use crossterm::{cursor, execute, queue, style, terminal, tty::IsTty}; use crate::communication::reader::MainWindow;