From f9e69c40c791f9da40966ff69ebeeed26b4907e3 Mon Sep 17 00:00:00 2001 From: Cristiano Chieppa Date: Fri, 23 May 2025 11:30:43 +0200 Subject: [PATCH] Update derive_more requirement from 0.99 to 2.0 --- protocol/Cargo.toml | 2 +- protocol/src/message/amqp/types/primitives/value.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index c866e5e3..b1765957 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -16,7 +16,7 @@ ordered-float = "4.1.0" uuid = "1" chrono = "0.4.26" num_enum = "0.7.0" -derive_more = "0.99" +derive_more = { version = "2.0.1", features = ["full"] } [dev-dependencies] pretty_assertions = "1.2.0" diff --git a/protocol/src/message/amqp/types/primitives/value.rs b/protocol/src/message/amqp/types/primitives/value.rs index 21aa8bff..93147c9d 100644 --- a/protocol/src/message/amqp/types/primitives/value.rs +++ b/protocol/src/message/amqp/types/primitives/value.rs @@ -180,9 +180,9 @@ macro_rules! impl_try_from_simple_value_ref { fn try_from(value: &'a Value) -> Result { use std::convert::TryInto; match value { - Value::Simple(simple) => simple - .try_into() - .map_err(|err: &str| DecodeError::MessageParse(err.to_string())), + Value::Simple(simple) => simple.try_into().map_err(|_| { + DecodeError::MessageParse("Failed to cast Value to simple type".to_string()) + }), _ => Err(DecodeError::MessageParse( "Failed to cast Value to simple type".to_string(), )),