From 6576dda56d960dd3daabef24514ac8705ac756fe Mon Sep 17 00:00:00 2001 From: Brett Mayson Date: Mon, 20 Nov 2023 20:59:46 +0000 Subject: [PATCH] update deps, update to rust 1.74 --- Cargo.lock | 164 +++++++++++------------ Cargo.toml | 11 +- bin/Cargo.toml | 7 +- bin/build.rs | 2 +- bin/src/commands/launch.rs | 6 + bin/src/lib.rs | 3 - bin/src/main.rs | 7 +- bin/tests/build.rs | 2 + bin/tests/preset.rs | 4 +- libs/common/Cargo.toml | 3 + libs/common/src/lib.rs | 3 - libs/common/src/version.rs | 31 ++--- libs/config/Cargo.toml | 3 + libs/config/src/lib.rs | 2 - libs/config/src/parse/mod.rs | 4 +- libs/pbo/Cargo.toml | 3 + libs/pbo/src/lib.rs | 2 - libs/pbo/tests/ace_weather.rs | 12 +- libs/pbo/tests/utils.rs | 13 +- libs/preprocessor/Cargo.toml | 3 + libs/preprocessor/benches/ace_dogtags.rs | 2 +- libs/preprocessor/src/lib.rs | 3 - libs/signing/Cargo.toml | 5 +- libs/signing/src/lib.rs | 3 - 24 files changed, 149 insertions(+), 149 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0a29ac4..8f6cc0fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" dependencies = [ - "hashbrown 0.14.2", + "hashbrown", "stacker", ] @@ -285,18 +285,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -583,9 +583,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ "libc", "windows-sys 0.48.0", @@ -703,9 +703,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -741,9 +741,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -751,7 +751,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -764,12 +764,6 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.2" @@ -812,7 +806,7 @@ dependencies = [ "vfs", "walkdir", "whoami", - "winreg 0.51.0", + "winreg 0.52.0", "zip", ] @@ -848,7 +842,7 @@ version = "1.0.1" dependencies = [ "byteorder", "hemtt-common", - "indexmap 2.1.0", + "indexmap", "serde", "sha-1", ] @@ -899,9 +893,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -978,16 +972,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.1.0" @@ -995,7 +979,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown", ] [[package]] @@ -1102,9 +1086,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libgit2-sys" @@ -1126,6 +1110,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall", +] + [[package]] name = "libssh2-sys" version = "0.3.0" @@ -1154,9 +1149,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "log" @@ -1327,9 +1322,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.58" +version = "0.10.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dfc0783362704e97ef3bd24261995a699468440099ef95d869b4d9732f829a" +checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -1359,9 +1354,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.94" +version = "0.9.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f55da20b29f956fb01f0add8683eb26ee13ebe3ebd935e49898717c6b4b2830" +checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" dependencies = [ "cc", "libc", @@ -1626,15 +1621,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -1646,12 +1632,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] @@ -1751,9 +1737,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ef35bf3e7fe15a53c4ab08a998e42271eab13eb0db224126bc7bc4c4bad96d" +checksum = "6a3211b01eea83d80687da9eef70e39d65144a3894866a5153a2723e425a157f" dependencies = [ "const-oid", "digest", @@ -1811,9 +1797,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", "errno", @@ -1883,18 +1869,18 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", @@ -1994,9 +1980,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", @@ -2013,9 +1999,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smartstring" @@ -2110,9 +2096,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -2148,7 +2134,7 @@ checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", + "redox_syscall", "rustix", "windows-sys 0.48.0", ] @@ -2248,9 +2234,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -2288,9 +2274,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", @@ -2309,11 +2295,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.1.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -2360,9 +2346,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", @@ -2381,9 +2367,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", "serde", @@ -2774,9 +2760,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -2802,9 +2788,9 @@ dependencies = [ [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -2818,18 +2804,18 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.21" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686b7e407015242119c33dab17b8f61ba6843534de936d94368856528eae4dcc" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.21" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020f3dfe25dfc38dfea49ce62d5d45ecdd7f0d8a724fa63eb36b6eba4ec76806" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" dependencies = [ "proc-macro2", "quote", @@ -2838,9 +2824,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" [[package]] name = "zip" diff --git a/Cargo.toml b/Cargo.toml index b45edba3..31b96990 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,20 +15,25 @@ resolver = "2" [workspace.dependencies] ariadne = "0.3.0" byteorder = "1.5.0" -clap = "4.4.7" +clap = "4.4.8" git2 = "0.18.1" lsp-types = "0.94.1" peekmore = "1.3.0" pest = "2.7.5" pest_derive = "2.7.5" -serde = { version = "1.0.190", features = ["derive"] } +serde = { version = "1.0.192", features = ["derive"] } serde_json = "1.0.108" sha-1 = "0.10.1" -toml = "0.8.6" +toml = "0.8.8" tracing = { version = "0.1.40", features = ["attributes"] } vfs = "0.10.0" walkdir = "2.4.0" zip = "0.6.6" +[workspace.lints.clippy] +all = "deny" +nursery = "deny" +pedantic = "warn" + [profile.bench] lto = true diff --git a/bin/Cargo.toml b/bin/Cargo.toml index 5cfe9b27..ed975428 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -6,6 +6,9 @@ edition = "2021" license = "GPL-2.0" authors = ["Brett Mayson "] +[lints] +workspace = true + [lib] bench = false @@ -39,7 +42,7 @@ serde_json = { workspace = true } steamlocate = "2.0.0-alpha.0" time = { version = "0.3.30", features = ["formatting"] } tracing = { workspace = true } -tracing-subscriber = { version = "0.3.17", features = ["json"] } +tracing-subscriber = { version = "0.3.18", features = ["json"] } vfs = { workspace = true } walkdir = { workspace = true } whoami = "1.4.1" @@ -47,7 +50,7 @@ zip = { workspace = true } [target.'cfg(windows)'.dependencies] enable-ansi-support = "0.2.1" -winreg = "0.51.0" +winreg = "0.52.0" [dev-dependencies] paste = "1.0.14" diff --git a/bin/build.rs b/bin/build.rs index 3686e48b..f70892c9 100644 --- a/bin/build.rs +++ b/bin/build.rs @@ -8,5 +8,5 @@ pub fn main() { if cfg!(debug_assertions) { base.push_str("-debug"); } - println!("cargo:rustc-env=HEMTT_VERSION={}", base); + println!("cargo:rustc-env=HEMTT_VERSION={base}"); } diff --git a/bin/src/commands/launch.rs b/bin/src/commands/launch.rs index f9c038b4..bb1708ce 100644 --- a/bin/src/commands/launch.rs +++ b/bin/src/commands/launch.rs @@ -44,6 +44,9 @@ pub fn cli() -> Command { /// /// # Errors /// [`Error`] depending on the modules +/// +/// # Panics +/// Will panic if the regex can not be compiled, which should never be the case in a released version pub fn execute(matches: &ArgMatches) -> Result<(), Error> { let config = ProjectConfig::from_file(&Path::new(".hemtt").join("project.toml"))?; let Some(mainprefix) = config.mainprefix() else { @@ -210,6 +213,9 @@ pub fn execute(matches: &ArgMatches) -> Result<(), Error> { } /// Read a preset file and return the mods and DLCs +/// +/// # Panics +/// Will panic if the regex can not be compiled, which should never be the case in a released version pub fn read_preset(name: &str, html: &str) -> (Vec, Vec) { let mut workshop = Vec::new(); let mut dlc = Vec::new(); diff --git a/bin/src/lib.rs b/bin/src/lib.rs index 4f451cbd..8bb06cde 100644 --- a/bin/src/lib.rs +++ b/bin/src/lib.rs @@ -1,6 +1,3 @@ -#![deny(clippy::all, clippy::nursery)] -#![warn(clippy::pedantic)] - use clap::{ArgAction, ArgMatches, Command}; use context::Context; pub use error::Error; diff --git a/bin/src/main.rs b/bin/src/main.rs index 84b0252f..b49377a1 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -1,7 +1,4 @@ -#![deny(clippy::all, clippy::nursery)] -#![warn(clippy::pedantic)] - -use tracing::{error, warn}; +use tracing::error; fn main() { std::panic::set_hook(Box::new(|panic| { @@ -26,7 +23,7 @@ It is always best to the include the log and a link to your project when reporti #[cfg(windows)] if enable_ansi_support::enable_ansi_support().is_err() { - warn!("Failed to enable ANSI support, colored output will not work"); + tracing::warn!("Failed to enable ANSI support, colored output will not work"); } if let Err(e) = hemtt::execute(&hemtt::cli().get_matches()) { diff --git a/bin/tests/build.rs b/bin/tests/build.rs index 48707619..a454b268 100644 --- a/bin/tests/build.rs +++ b/bin/tests/build.rs @@ -1,6 +1,8 @@ use hemtt::cli; #[test] +/// # Panics +/// Will panic if there is an issue with the test pub fn build() { std::env::set_current_dir("tests/alpha").unwrap(); hemtt::execute(&cli().get_matches_from(vec!["hemtt", "dev", "--in-test"])).unwrap(); diff --git a/bin/tests/preset.rs b/bin/tests/preset.rs index 7170393f..29bdbff5 100644 --- a/bin/tests/preset.rs +++ b/bin/tests/preset.rs @@ -18,9 +18,7 @@ fn preset(name: &str, mods: usize, dlc: &[DLC]) { let html = PathBuf::from("tests/presets") .join(name) .with_extension("html"); - if !html.exists() { - panic!("Preset not found: {}", name); - } + assert!(html.exists(), "Preset not found: {name}"); let html = std::fs::read_to_string(html).unwrap(); let (preset_mods, preset_dlc) = read_preset(name, &html); assert_eq!(preset_mods.len(), mods); diff --git a/libs/common/Cargo.toml b/libs/common/Cargo.toml index 02029e34..73598297 100644 --- a/libs/common/Cargo.toml +++ b/libs/common/Cargo.toml @@ -5,6 +5,9 @@ edition = "2021" description = "A library for common Hemtt functionality" license = "GPL-2.0" +[lints] +workspace = true + [dependencies] git2 = { workspace = true } serde = { workspace = true } diff --git a/libs/common/src/lib.rs b/libs/common/src/lib.rs index 76fa8f72..65e4fe5c 100644 --- a/libs/common/src/lib.rs +++ b/libs/common/src/lib.rs @@ -1,6 +1,3 @@ -#![deny(clippy::all, clippy::nursery, missing_docs)] -#![warn(clippy::pedantic)] - //! HEMTT - Common Library pub mod arma; diff --git a/libs/common/src/version.rs b/libs/common/src/version.rs index b4fb271a..6672cd45 100644 --- a/libs/common/src/version.rs +++ b/libs/common/src/version.rs @@ -1,6 +1,3 @@ -#![deny(clippy::all, clippy::nursery, missing_docs)] -#![warn(clippy::pedantic)] - //! Versioning for Arma mods use std::fmt::{Display, Formatter}; @@ -308,12 +305,12 @@ mod tests { #[test] fn test_script_version() { - let content = r#" + let content = r" #define MAJOR 1 #define MINOR 2 #define PATCH 3 #define BUILD 4 - "#; + "; let version = Version::try_from_script_version(content).unwrap(); assert_eq!(version.major, 1); assert_eq!(version.minor, 2); @@ -325,12 +322,12 @@ mod tests { #[test] fn test_script_version_comment() { - let content = r#" + let content = r" #define MAJOR 1 #define MINOR 2 #define PATCHLVL 3 // some comment #define BUILD 4 - "#; + "; let version = Version::try_from_script_version(content).unwrap(); assert_eq!(version.major, 1); assert_eq!(version.minor, 2); @@ -341,11 +338,11 @@ mod tests { #[test] fn test_script_version_no_build() { - let content = r#" + let content = r" #define MAJOR 1 #define MINOR 2 #define PATCH 3 - "#; + "; let version = Version::try_from_script_version(content).unwrap(); assert_eq!(version.major, 1); assert_eq!(version.minor, 2); @@ -356,11 +353,11 @@ mod tests { #[test] fn test_script_version_invalid_component() { - let content = r#" + let content = r" #define MAJOR 1 #define MINOR 2 #define PATCHLVL a - "#; + "; let version = Version::try_from_script_version(content); assert!(version.is_err()); assert_eq!( @@ -371,9 +368,9 @@ mod tests { #[test] fn test_script_version_missing_minor() { - let content = r#" + let content = r" #define MAJOR 1 - "#; + "; let version = Version::try_from_script_version(content); assert!(version.is_err()); assert_eq!(version.unwrap_err(), Error::ExpectedMinor); @@ -381,10 +378,10 @@ mod tests { #[test] fn test_script_version_missing_patch() { - let content = r#" + let content = r" #define MAJOR 1 #define MINOR 2 - "#; + "; let version = Version::try_from_script_version(content); assert!(version.is_err()); assert_eq!(version.unwrap_err(), Error::ExpectedPatch); @@ -392,10 +389,10 @@ mod tests { #[test] fn test_script_version_missing_major() { - let content = r#" + let content = r" #define MINOR 2 #define PATCH 3 - "#; + "; let version = Version::try_from_script_version(content); assert!(version.is_err()); assert_eq!(version.unwrap_err(), Error::ExpectedMajor); diff --git a/libs/config/Cargo.toml b/libs/config/Cargo.toml index 992121f5..4066f26a 100644 --- a/libs/config/Cargo.toml +++ b/libs/config/Cargo.toml @@ -5,6 +5,9 @@ edition = "2021" description = "A config parser library for hemtt" license = "GPL-2.0" +[lints] +workspace = true + [lib] bench = false diff --git a/libs/config/src/lib.rs b/libs/config/src/lib.rs index 9b48201e..59b10bf1 100644 --- a/libs/config/src/lib.rs +++ b/libs/config/src/lib.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all, clippy::nursery, missing_docs)] -#![warn(clippy::pedantic)] #![allow(clippy::cast_possible_truncation)] //! HEMTT - Arma 3 Config Parser diff --git a/libs/config/src/parse/mod.rs b/libs/config/src/parse/mod.rs index e635d3cb..4787b0a4 100644 --- a/libs/config/src/parse/mod.rs +++ b/libs/config/src/parse/mod.rs @@ -33,8 +33,8 @@ mod tests { #[test] fn empty() { - assert_eq!(config().parse(r#""#,), Ok(Config(vec![]),)); - assert_eq!(config().parse(r#" "#,), Ok(Config(vec![]),)); + assert_eq!(config().parse(r"",), Ok(Config(vec![]),)); + assert_eq!(config().parse(r" ",), Ok(Config(vec![]),)); } #[test] diff --git a/libs/pbo/Cargo.toml b/libs/pbo/Cargo.toml index 02deee7d..e582f6ba 100644 --- a/libs/pbo/Cargo.toml +++ b/libs/pbo/Cargo.toml @@ -5,6 +5,9 @@ edition = "2021" description = "An PBO library for hemtt" license = "GPL-2.0" +[lints] +workspace = true + [lib] bench = false diff --git a/libs/pbo/src/lib.rs b/libs/pbo/src/lib.rs index 926e4c9c..5ee1eeb1 100644 --- a/libs/pbo/src/lib.rs +++ b/libs/pbo/src/lib.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all, clippy::nursery, missing_docs)] -#![warn(clippy::pedantic)] #![allow(clippy::cast_possible_truncation, clippy::cast_lossless)] //! HEMTT - Arma 3 PBO Writer/Reader diff --git a/libs/pbo/tests/ace_weather.rs b/libs/pbo/tests/ace_weather.rs index 61518b1d..d0676032 100644 --- a/libs/pbo/tests/ace_weather.rs +++ b/libs/pbo/tests/ace_weather.rs @@ -19,7 +19,7 @@ fn ace_weather_cba6f72c() { header( pbo.files().first().unwrap(), "$PBOPREFIX$.backup", - Mime::Blank, + &Mime::Blank, 20, 0, 1_543_422_611, @@ -28,7 +28,7 @@ fn ace_weather_cba6f72c() { header( pbo.header("$PBOPREFIX$.backup").unwrap(), "$PBOPREFIX$.backup", - Mime::Blank, + &Mime::Blank, 20, 0, 1_543_422_611, @@ -37,7 +37,7 @@ fn ace_weather_cba6f72c() { file( &mut pbo, "XEH_preStart.sqf", - "#include \"script_component.hpp\"\r\n\r\n#include \"XEH_PREP.hpp\"\r\n".to_string(), + "#include \"script_component.hpp\"\r\n\r\n#include \"XEH_PREP.hpp\"\r\n", ); let mut new_pbo = WritablePbo::new(); let mut new_files = std::collections::HashMap::new(); @@ -85,7 +85,7 @@ fn ace_weather_8bd4922f() { header( pbo.files().first().unwrap(), "$PBOPREFIX$.backup", - Mime::Blank, + &Mime::Blank, 20, 0, 1_615_389_445, @@ -94,7 +94,7 @@ fn ace_weather_8bd4922f() { header( pbo.header("$PBOPREFIX$.backup").unwrap(), "$PBOPREFIX$.backup", - Mime::Blank, + &Mime::Blank, 20, 0, 1_615_389_445, @@ -103,6 +103,6 @@ fn ace_weather_8bd4922f() { file( &mut pbo, "XEH_preStart.sqf", - "#include \"script_component.hpp\"\r\n\r\n#include \"XEH_PREP.hpp\"\r\n".to_string(), + "#include \"script_component.hpp\"\r\n\r\n#include \"XEH_PREP.hpp\"\r\n", ); } diff --git a/libs/pbo/tests/utils.rs b/libs/pbo/tests/utils.rs index 16f185a3..78bb82df 100644 --- a/libs/pbo/tests/utils.rs +++ b/libs/pbo/tests/utils.rs @@ -2,6 +2,9 @@ use std::{fs::File, io::Read}; use hemtt_pbo::{Checksum, Header, Mime, ReadablePbo}; +#[must_use] +/// # Panics +/// Will panic if there is an issue with the test pub fn pbo( file: File, file_count: usize, @@ -37,24 +40,28 @@ pub fn pbo( // assert_eq!(original.checksum(), writeable.checksum().unwrap()); // } +/// # Panics +/// Will panic if there is an issue with the test pub fn header( header: &Header, filename: &str, - method: Mime, + method: &Mime, original: u32, reserved: u32, timestamp: u32, size: u32, ) { assert_eq!(header.filename(), filename); - assert_eq!(header.mime(), &method); + assert_eq!(header.mime(), method); assert_eq!(header.original(), original); assert_eq!(header.reserved(), reserved); assert_eq!(header.timestamp(), timestamp); assert_eq!(header.size(), size); } -pub fn file(pbo: &mut ReadablePbo, file: &str, content: String) { +/// # Panics +/// Will panic if there is an issue with the test +pub fn file(pbo: &mut ReadablePbo, file: &str, content: &str) { let mut cursor = pbo.file(file).unwrap().unwrap(); let mut data = String::new(); cursor.read_to_string(&mut data).unwrap(); diff --git a/libs/preprocessor/Cargo.toml b/libs/preprocessor/Cargo.toml index 636dcfb8..94dd798a 100644 --- a/libs/preprocessor/Cargo.toml +++ b/libs/preprocessor/Cargo.toml @@ -5,6 +5,9 @@ edition = "2021" description = "A preprocessor library for hemtt" license = "GPL-2.0" +[lints] +workspace = true + [lib] bench = false diff --git a/libs/preprocessor/benches/ace_dogtags.rs b/libs/preprocessor/benches/ace_dogtags.rs index 5af1a9d1..0dd815bf 100644 --- a/libs/preprocessor/benches/ace_dogtags.rs +++ b/libs/preprocessor/benches/ace_dogtags.rs @@ -12,7 +12,7 @@ fn criterion_benchmark(c: &mut Criterion) { c.bench_function("preprocess - ace dogtags", |b| { b.iter(|| { hemtt_preprocessor::Processor::run(&source).unwrap(); - }) + }); }); } diff --git a/libs/preprocessor/src/lib.rs b/libs/preprocessor/src/lib.rs index 7032c602..9b78710a 100644 --- a/libs/preprocessor/src/lib.rs +++ b/libs/preprocessor/src/lib.rs @@ -1,6 +1,3 @@ -#![deny(clippy::all, clippy::nursery, missing_docs)] -#![warn(clippy::pedantic)] - //! HEMTT - Arma 3 Preprocessor mod codes; diff --git a/libs/signing/Cargo.toml b/libs/signing/Cargo.toml index f6281182..7f56b527 100644 --- a/libs/signing/Cargo.toml +++ b/libs/signing/Cargo.toml @@ -5,6 +5,9 @@ edition = "2021" description = "A signing library for hemtt" license = "GPL-2.0" +[lints] +workspace = true + [lib] bench = false @@ -15,5 +18,5 @@ hemtt-pbo = { path = "../pbo", version = "1.0.0" } byteorder = { workspace = true } rand = "0.8.5" -rsa = "0.9.3" +rsa = "0.9.4" sha-1 = { workspace = true } diff --git a/libs/signing/src/lib.rs b/libs/signing/src/lib.rs index 9c9aace4..110d5a12 100644 --- a/libs/signing/src/lib.rs +++ b/libs/signing/src/lib.rs @@ -1,6 +1,3 @@ -#![deny(clippy::all, clippy::nursery, missing_docs)] -#![warn(clippy::pedantic)] - //! HEMTT - Arma 3 Signing // Parts of the following code is derivative work of the code from the armake2 project by KoffeinFlummi,