Merge pull request 'chore(deps): update rust crate bincode to v2' (#204) from renovate/bincode-2.x into master
All checks were successful
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc

Reviewed-on: #204
This commit is contained in:
Lucas Schwiderski 2025-04-22 14:51:45 +02:00
commit 48683638f6
Signed by: Forgejo (git.sclu1034.dev)
GPG key ID: B1C9C29730D3D366
3 changed files with 53 additions and 15 deletions

27
Cargo.lock generated
View file

@ -209,11 +209,22 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bincode"
version = "1.3.3"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740"
dependencies = [
"bincode_derive",
"serde",
"unty",
]
[[package]]
name = "bincode_derive"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09"
dependencies = [
"virtue",
]
[[package]]
@ -4251,6 +4262,12 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "unty"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae"
[[package]]
name = "url"
version = "2.5.4"
@ -4337,6 +4354,12 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "virtue"
version = "0.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1"
[[package]]
name = "vte"
version = "0.14.1"

View file

@ -15,7 +15,7 @@ exclude = ["lib/color-eyre"]
ansi-parser = "0.9.1"
ansi_term = "0.12.1"
async-recursion = "1.0.5"
bincode = "1.3.3"
bincode = "2.0.0"
bitflags = "2.5.0"
byteorder = "1.4.3"
clap = { version = "4.0.15", features = ["color", "derive", "std", "cargo", "string", "unicode"] }

View file

@ -52,10 +52,14 @@ fn notify_nxm_download(
tracing::debug!("Connected to main process at '{}'", IPC_ADDRESS);
bincode::serialize_into(&mut stream, uri.as_ref()).wrap_err("Failed to send URI")?;
let bincode_config = bincode::config::standard();
bincode::encode_into_std_write(uri.as_ref(), &mut stream, bincode_config)
.wrap_err("Failed to send URI")?;
// We don't really care what the message is, we just need an acknowledgement.
let _: String = bincode::deserialize_from(&mut stream).wrap_err("Failed to receive reply")?;
let _: String = bincode::decode_from_std_read(&mut stream, bincode_config)
.wrap_err("Failed to receive reply")?;
tracing::info!(
"Notified DTMM with uri '{}'. Check the main window.",
@ -160,7 +164,10 @@ fn main() -> Result<()> {
match res {
Ok(mut stream) => {
let res = bincode::deserialize_from(&mut stream)
let res = bincode::decode_from_std_read(
&mut stream,
bincode::config::standard(),
)
.wrap_err("Failed to read message")
.and_then(|uri: String| {
tracing::trace!(uri, "Received NXM uri");
@ -171,11 +178,19 @@ fn main() -> Result<()> {
});
match res {
Ok(()) => {
let _ = bincode::serialize_into(&mut stream, "Ok");
let _ = bincode::encode_into_std_write(
"Ok",
&mut stream,
bincode::config::standard(),
);
}
Err(err) => {
tracing::error!("{:?}", err);
let _ = bincode::serialize_into(&mut stream, "Error");
let _ = bincode::encode_into_std_write(
"Error",
&mut stream,
bincode::config::standard(),
);
}
}
}