From f91e77bc15d7453738d45b052312f52055674c9f Mon Sep 17 00:00:00 2001 From: "Michael X. Grey" Date: Mon, 2 Dec 2024 20:42:38 +0800 Subject: [PATCH] Fix clippy for rosidl_runtime_rs Signed-off-by: Michael X. Grey --- rosidl_runtime_rs/src/string/serde.rs | 2 +- rosidl_runtime_rs/src/traits.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rosidl_runtime_rs/src/string/serde.rs b/rosidl_runtime_rs/src/string/serde.rs index fe68661b5..0ded3fd4a 100644 --- a/rosidl_runtime_rs/src/string/serde.rs +++ b/rosidl_runtime_rs/src/string/serde.rs @@ -13,7 +13,7 @@ use super::{ struct StringVisitor; struct WStringVisitor; -impl<'de> Visitor<'de> for StringVisitor { +impl Visitor<'_> for StringVisitor { type Value = String; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rosidl_runtime_rs/src/traits.rs b/rosidl_runtime_rs/src/traits.rs index 1e0908544..61d8c2392 100644 --- a/rosidl_runtime_rs/src/traits.rs +++ b/rosidl_runtime_rs/src/traits.rs @@ -124,10 +124,11 @@ pub trait RmwMessage: Clone + Debug + Default + Send + Sync + Message { /// /// Memory ownership by C is achieved by calling `init()` when any string or sequence is created, /// as well as in the `Default` impl for messages. +/// /// User code can still create messages explicitly, which will not call `init()`, but this is not a -/// problem, since nothing is allocated this way. +/// problem, since nothing is allocated this way. +/// /// The `Drop` impl for any sequence or string will call `fini()`. - pub trait Message: Clone + Debug + Default + 'static + Send + Sync { /// The corresponding RMW-native message type. type RmwMsg: RmwMessage;