fix compiler warnings
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
6d46692e4c
commit
c8c98bc3df
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -564,7 +564,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ghost-telemetry-core"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bimap",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ghost-telemetry-shard"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Uncle Stinky uncle.stinky@ghostchain.io"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@ -307,14 +307,14 @@ where
|
||||
// Deserialize from JSON, warning in debug mode if deserialization fails:
|
||||
let node_message: json_message::NodeMessage = match serde_json::from_slice(&bytes) {
|
||||
Ok(node_message) => node_message,
|
||||
#[cfg(debug)]
|
||||
#[cfg(debug_assertions)]
|
||||
Err(e) => {
|
||||
let bytes: &[u8] = bytes.get(..512).unwrap_or_else(|| &bytes);
|
||||
let msg_start = std::str::from_utf8(bytes).unwrap_or_else(|_| "INVALID UTF8");
|
||||
log::warn!("Failed to parse node message ({msg_start}): {e}");
|
||||
continue;
|
||||
},
|
||||
#[cfg(not(debug))]
|
||||
#[cfg(not(debug_assertions))]
|
||||
Err(_) => {
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user