From c97253c5485a5bcb2065df7ce689384eb842ffbb Mon Sep 17 00:00:00 2001 From: Simone Zandara Date: Fri, 17 Sep 2021 11:31:27 +0200 Subject: [PATCH] Fix colcon build when no actions/msgs/services are present Description: The auto generated lib r2r_msg_gen assume the presence of at least 1 entry in the messages, actions or services. If none is present it generates a file with a dangling "else" which generates a compilation error. Removing the else altogether fixes the issue. Test: - cargo test - cd r2r_msg_gen/ && cargo test - colcon build on local package with no actions --- r2r_msg_gen/src/lib.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/r2r_msg_gen/src/lib.rs b/r2r_msg_gen/src/lib.rs index 80ca0d4..6fe395a 100644 --- a/r2r_msg_gen/src/lib.rs +++ b/r2r_msg_gen/src/lib.rs @@ -518,10 +518,7 @@ impl WrappedNativeMsgUntyped { ); let close = String::from( " - else - { - return Err(Error::InvalidMessageType{ msgtype: typename.into() }) - } + return Err(Error::InvalidMessageType{ msgtype: typename.into() }) } } ", @@ -560,10 +557,7 @@ impl UntypedServiceSupport { ); let close = String::from( " - else - { - return Err(Error::InvalidMessageType{ msgtype: typename.into() }) - } + return Err(Error::InvalidMessageType{ msgtype: typename.into() }) } } ", @@ -601,10 +595,7 @@ impl UntypedActionSupport { ); let close = String::from( " - else - { - return Err(Error::InvalidMessageType{ msgtype: typename.into() }) - } + return Err(Error::InvalidMessageType{ msgtype: typename.into() }) } } ",