From 620702e3982ba4cba7dbcd23ebd12b443801cc0f Mon Sep 17 00:00:00 2001 From: Juhana Helovuo Date: Tue, 19 Nov 2024 17:39:15 +0200 Subject: [PATCH] fmt --- src/messages/submessages/elements/inline_qos.rs | 6 ++++-- src/rtps/message.rs | 12 ++++++------ src/structure/parameter_id.rs | 13 +++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/messages/submessages/elements/inline_qos.rs b/src/messages/submessages/elements/inline_qos.rs index 7e61326e..1b3f5ebc 100644 --- a/src/messages/submessages/elements/inline_qos.rs +++ b/src/messages/submessages/elements/inline_qos.rs @@ -62,8 +62,10 @@ impl InlineQos { .parameters .iter() // We look for two PIDs, because there is some unclarity about which one should be used. - .find(|p| p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY - || p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY_CUSTOM ); + .find(|p| { + p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY + || p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY_CUSTOM + }); let endianness = match representation_id { RepresentationIdentifier::PL_CDR_LE => Endianness::LittleEndian, diff --git a/src/rtps/message.rs b/src/rtps/message.rs index b15c44d6..5b0a5ae9 100644 --- a/src/rtps/message.rs +++ b/src/rtps/message.rs @@ -223,9 +223,9 @@ impl MessageBuilder { // If we are sending related sample identity, then insert that. if let Some(si) = cache_change.write_options.related_sample_identity() { let related_sample_identity_serialized = si.write_to_vec_with_ctx(endianness).unwrap(); - // Insert two parameters, because we are not sure which one is the correct parameter id. - // Or what the receiver thinks is correct. This behaviour was observed from - // eProsima FastDDS on 2024-11-18. + // Insert two parameters, because we are not sure which one is the correct + // parameter id. Or what the receiver thinks is correct. This behaviour + // was observed from eProsima FastDDS on 2024-11-18. param_list.push(Parameter { parameter_id: ParameterId::PID_RELATED_SAMPLE_IDENTITY, value: related_sample_identity_serialized.clone(), @@ -360,9 +360,9 @@ impl MessageBuilder { // If we are sending related sample identity, then insert that. if let Some(si) = cache_change.write_options.related_sample_identity() { let related_sample_identity_serialized = si.write_to_vec_with_ctx(endianness).unwrap(); - // Insert two parameters, because we are not sure which one is the correct parameter id. - // Or what the receiver thinks is correct. This behaviour was observed from - // eProsima FastDDS on 2024-11-18. + // Insert two parameters, because we are not sure which one is the correct + // parameter id. Or what the receiver thinks is correct. This behaviour + // was observed from eProsima FastDDS on 2024-11-18. param_list.push(Parameter { parameter_id: ParameterId::PID_RELATED_SAMPLE_IDENTITY, value: related_sample_identity_serialized.clone(), diff --git a/src/structure/parameter_id.rs b/src/structure/parameter_id.rs index b3db448c..0503526b 100644 --- a/src/structure/parameter_id.rs +++ b/src/structure/parameter_id.rs @@ -85,14 +85,15 @@ impl ParameterId { // https://github.com/eProsima/Fast-DDS/commit/359eeaadd0ff0216aa1968a8ea34b5092c4f346e // They changed PID_RELATED_SAMPLE_IDENTITY from 0x800f to 0x0083. // - // PID 0x800f is still supported in FastDDS, and it is called PID_CUSTOM_RELATED_SAMPLE_IDENTITY, which - // naming we will copy, so that future debugging is less confusing. Now FastDDS sends - // both of these PIDs in Inline QoS, if it needs to send related_sample_identity. This seems like + // PID 0x800f is still supported in FastDDS, and it is called + // PID_CUSTOM_RELATED_SAMPLE_IDENTITY, which naming we will copy, so that + // future debugging is less confusing. Now FastDDS sends both of these PIDs in + // Inline QoS, if it needs to send related_sample_identity. This seems like // a good idea for backward compatibility. // - // The receive behaviour of FastDDS is somewhat unclear. They recognize both versions on receive, - // but receiveing related_sample_identity does not work correctly with PID=0x800f in - // ROS 2 Jazzy. + // The receive behaviour of FastDDS is somewhat unclear. They recognize both + // versions on receive, but receiveing related_sample_identity does not work + // correctly with PID=0x800f in ROS 2 Jazzy. pub const PID_RELATED_SAMPLE_IDENTITY: Self = Self { value: 0x0083 }; pub const PID_RELATED_SAMPLE_IDENTITY_CUSTOM: Self = Self { value: 0x800f };