1 Commits

Author SHA1 Message Date
83ffaca23f Update Rust crate bincode to v3
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-30 00:39:31 +00:00
3 changed files with 8 additions and 34 deletions

View File

@@ -536,24 +536,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a"
[[package]] [[package]]
name = "bincode-next" name = "bincode"
version = "2.0.4" version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a347d3b94606a7b3d588fe1ff7f41996bbb3690ade4e79935b26565af10e03f" checksum = "fd6a120d2e16b3e1b4a24bd70f23b12d3e16b81f113364a26935f8db7245452d"
dependencies = [
"bincode_derive-next",
"serde",
"unty-next",
]
[[package]]
name = "bincode_derive-next"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "197e777c78cc9fbe8396cf82e18f84bb6026b8ec534ebb3097f4d98894e8b540"
dependencies = [
"virtue-next",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
@@ -646,7 +632,7 @@ dependencies = [
"actix-web", "actix-web",
"anyhow", "anyhow",
"asn1", "asn1",
"bincode-next", "bincode",
"chrono", "chrono",
"clap", "clap",
"dotenvy", "dotenvy",
@@ -3453,12 +3439,6 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "unty-next"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "169ea32c8f5801e4b397f08d2b5d3d0d3675d11c241aad7338b601beed52a291"
[[package]] [[package]]
name = "url" name = "url"
version = "2.5.7" version = "2.5.7"
@@ -3507,12 +3487,6 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "virtue-next"
version = "0.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4daab4b8a8c3c1408ea5e60a5d380790ff15d0cfe0333c14ce98210c1339fd8"
[[package]] [[package]]
name = "walkdir" name = "walkdir"
version = "2.5.0" version = "2.5.0"

View File

@@ -40,7 +40,7 @@ jsonwebtoken = { version = "10.2.0", features = ["use_pem", "rust_crypto"] }
prettytable-rs = "0.10.0" prettytable-rs = "0.10.0"
chrono = "0.4.42" chrono = "0.4.42"
serde_yml = "0.0.12" serde_yml = "0.0.12"
bincode-next = "2.0.4" bincode = "3.0.0"
fs4 = { version = "0.13.1", features = ["sync"] } fs4 = { version = "0.13.1", features = ["sync"] }
zip = { version = "6.0.0", features = ["bzip2"] } zip = { version = "6.0.0", features = ["bzip2"] }
walkdir = "2.5.0" walkdir = "2.5.0"

View File

@@ -29,9 +29,9 @@ impl ConsumptionHistoryFile {
if path.exists() { if path.exists() {
Ok(Self { Ok(Self {
day, day,
buff: bincode_next::decode_from_slice( buff: bincode::decode_from_slice(
&std::fs::read(path)?, &std::fs::read(path)?,
bincode_next::config::standard(), bincode::config::standard(),
)? )?
.0, .0,
r#type, r#type,
@@ -94,7 +94,7 @@ impl ConsumptionHistoryFile {
let path = AppConfig::get().energy_consumption_history_day(self.day, self.r#type); let path = AppConfig::get().energy_consumption_history_day(self.day, self.r#type);
std::fs::write( std::fs::write(
path, path,
bincode_next::encode_to_vec(&self.buff, bincode_next::config::standard())?, bincode::encode_to_vec(&self.buff, bincode::config::standard())?,
)?; )?;
Ok(()) Ok(())
} }