From b99057a40da12ec0bdeddc3f4f02fa3426f10e4b Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Fri, 21 Feb 2025 16:46:22 +0100 Subject: [PATCH] Move to 2024 edition, fix oddities from 2021 --- Cargo.lock | 60 ++++++++++++++++++++++++++- Cargo.toml | 4 +- libsysinspect/Cargo.toml | 16 ++++--- libsysinspect/src/mdescr/datapatch.rs | 2 +- libsysinspect/src/mdescr/mspec.rs | 4 +- modules/fs/file/Cargo.toml | 2 +- modules/sys/net/Cargo.toml | 2 +- modules/sys/proc/Cargo.toml | 2 +- modules/sys/run/Cargo.toml | 2 +- modules/sys/ssrun/Cargo.toml | 2 +- sysmaster/Cargo.toml | 3 +- sysminion/Cargo.toml | 2 +- 12 files changed, 82 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f702040a..ee3da72a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1158,6 +1158,18 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + [[package]] name = "fastrand" version = "2.3.0" @@ -1212,6 +1224,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1508,6 +1526,18 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.2", +] [[package]] name = "heck" @@ -2153,6 +2183,17 @@ dependencies = [ "libc", ] +[[package]] +name = "libsqlite3-sys" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8935b44e7c13394a179a438e0cebba0fe08fe01b54f152e29a93b5cf993fd4" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libssh2-sys" version = "0.3.1" @@ -2169,7 +2210,7 @@ dependencies = [ [[package]] name = "libsysinspect" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "base64 0.22.1", @@ -3357,6 +3398,20 @@ dependencies = [ "serde_yaml", ] +[[package]] +name = "rusqlite" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6d5e5acb6f6129fe3f7ba0a7fc77bca1942cb568535e18e7bc40262baf3110" +dependencies = [ + "bitflags 2.8.0", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -4283,7 +4338,7 @@ dependencies = [ [[package]] name = "sysinspect" -version = "0.2.0" +version = "0.3.0" dependencies = [ "chrono", "clap 4.5.30", @@ -4312,6 +4367,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "rsa", + "rusqlite", "rustls", "rustls-pemfile", "serde", diff --git a/Cargo.toml b/Cargo.toml index 40a23cd3..1e1db1e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sysinspect" -version = "0.2.0" -edition = "2021" +version = "0.3.0" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libsysinspect/Cargo.toml b/libsysinspect/Cargo.toml index 0f61f40d..0cda95a7 100644 --- a/libsysinspect/Cargo.toml +++ b/libsysinspect/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libsysinspect" -version = "0.2.0" -edition = "2021" +version = "0.3.0" +edition = "2024" [dependencies] base64 = "0.22.1" @@ -21,9 +21,15 @@ rand = "0.8.5" regex = "1.10.6" rsa = { version = "0.9.6", features = ["pkcs5", "sha1", "sha2"] } #rustpython = { path = "../../RustPython", features = ["freeze-stdlib"] } -rustpython-pylib = { git="https://github.com/RustPython/RustPython.git", features = ["freeze-stdlib"] } -rustpython = { git="https://github.com/RustPython/RustPython.git", features = ["freeze-stdlib"] } -rustpython-vm = { git = "https://github.com/RustPython/RustPython.git", features = ["freeze-stdlib"] } +rustpython-pylib = { git = "https://github.com/RustPython/RustPython.git", features = [ + "freeze-stdlib", +] } +rustpython = { git = "https://github.com/RustPython/RustPython.git", features = [ + "freeze-stdlib", +] } +rustpython-vm = { git = "https://github.com/RustPython/RustPython.git", features = [ + "freeze-stdlib", +] } serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" serde_yaml = "0.9.34" diff --git a/libsysinspect/src/mdescr/datapatch.rs b/libsysinspect/src/mdescr/datapatch.rs index 95043111..db19a9d2 100644 --- a/libsysinspect/src/mdescr/datapatch.rs +++ b/libsysinspect/src/mdescr/datapatch.rs @@ -38,7 +38,7 @@ fn modbase(base: &mut Value, mods: IndexMap, Value>) { }; let next = { - if let Value::Mapping(ref mut m) = cv { + if let Value::Mapping(m) = cv { if rm { m.remove(Value::String(clr_k.clone())); None diff --git a/libsysinspect/src/mdescr/mspec.rs b/libsysinspect/src/mdescr/mspec.rs index f3984f7c..3a640db5 100644 --- a/libsysinspect/src/mdescr/mspec.rs +++ b/libsysinspect/src/mdescr/mspec.rs @@ -1,5 +1,5 @@ use super::{datapatch, mspecdef::ModelSpec}; -use crate::{cfg::select_config_path, tmpl::render::ModelTplRender, traits::systraits::SystemTraits, SysinspectError}; +use crate::{SysinspectError, cfg::select_config_path, tmpl::render::ModelTplRender, traits::systraits::SystemTraits}; use indexmap::IndexMap; use serde_yaml::Value; use std::{ @@ -92,7 +92,7 @@ impl SpecLoader { for chunk in chunks { match (&mut base, chunk) { - (Value::Mapping(ref mut amp), Value::Mapping(bmp)) => { + (Value::Mapping(amp), Value::Mapping(bmp)) => { for (k, v) in bmp { if let Some(av) = amp.get_mut(k) { if let (Some(av_map), Some(v_map)) = (av.as_mapping_mut(), v.as_mapping_mut()) { diff --git a/modules/fs/file/Cargo.toml b/modules/fs/file/Cargo.toml index 9afa6ea8..5f7534bf 100644 --- a/modules/fs/file/Cargo.toml +++ b/modules/fs/file/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "file" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] chrono = "0.4.39" diff --git a/modules/sys/net/Cargo.toml b/modules/sys/net/Cargo.toml index 9f010deb..93d59a1e 100644 --- a/modules/sys/net/Cargo.toml +++ b/modules/sys/net/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "net" version = "0.2.0" -edition = "2021" +edition = "2024" [dependencies] libsysinspect = { path = "../../../libsysinspect" } diff --git a/modules/sys/proc/Cargo.toml b/modules/sys/proc/Cargo.toml index 2f909d9c..87d569bc 100644 --- a/modules/sys/proc/Cargo.toml +++ b/modules/sys/proc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "proc" version = "0.2.0" -edition = "2021" +edition = "2024" [dependencies] libsysinspect = { path = "../../../libsysinspect" } diff --git a/modules/sys/run/Cargo.toml b/modules/sys/run/Cargo.toml index 100b432d..6746e569 100644 --- a/modules/sys/run/Cargo.toml +++ b/modules/sys/run/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "run" version = "0.2.0" -edition = "2021" +edition = "2024" [dependencies] libsysinspect = { path = "../../../libsysinspect" } diff --git a/modules/sys/ssrun/Cargo.toml b/modules/sys/ssrun/Cargo.toml index 57550610..2131820d 100644 --- a/modules/sys/ssrun/Cargo.toml +++ b/modules/sys/ssrun/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ssrun" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] libsysinspect = { path = "../../../libsysinspect" } diff --git a/sysmaster/Cargo.toml b/sysmaster/Cargo.toml index e98675f0..4692063b 100644 --- a/sysmaster/Cargo.toml +++ b/sysmaster/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sysmaster" version = "0.3.0" -edition = "2021" +edition = "2024" [dependencies] clap = { version = "4.5.20", features = ["unstable-styles"] } @@ -36,3 +36,4 @@ actix-web = "4.9.0" once_cell = "1.20.2" daemonize = "0.5.0" indexmap = { version = "2.7.1", features = ["serde"] } +rusqlite = { version = "0.33.0", features = ["bundled"] } diff --git a/sysminion/Cargo.toml b/sysminion/Cargo.toml index 74f4b4ed..933f9edc 100644 --- a/sysminion/Cargo.toml +++ b/sysminion/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sysminion" version = "0.3.0" -edition = "2021" +edition = "2024" [dependencies] clap = { version = "4.5.20", features = ["unstable-styles"] }