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
This commit is contained in:
Simone Zandara 2021-09-17 11:31:27 +02:00
parent 1fb92fa5ca
commit c97253c548
1 changed files with 3 additions and 12 deletions

View File

@ -518,12 +518,9 @@ impl WrappedNativeMsgUntyped {
);
let close = String::from(
"
else
{
return Err(Error::InvalidMessageType{ msgtype: typename.into() })
}
}
}
",
);
@ -560,12 +557,9 @@ impl UntypedServiceSupport {
);
let close = String::from(
"
else
{
return Err(Error::InvalidMessageType{ msgtype: typename.into() })
}
}
}
",
);
@ -601,12 +595,9 @@ impl UntypedActionSupport {
);
let close = String::from(
"
else
{
return Err(Error::InvalidMessageType{ msgtype: typename.into() })
}
}
}
",
);