Skip to content

Commit d73394f

Browse files
committed
Fix mutability of rcl_is_context_valid argument
1 parent 38ce3e7 commit d73394f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rclrs/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ pub fn spin_once(node: &Node, timeout: Option<Duration>) -> Result<(), RclReturn
5555
/// This function additionally checks that the context is still valid.
5656
pub fn spin(node: &Node) -> Result<(), RclReturnCode> {
5757
// SAFETY: No preconditions for this function.
58-
while unsafe { rcl_context_is_valid(&*node.context.lock()) } {
58+
// The mutability of the argument has changed between ROS 2 versions, hence the extra `as _`
59+
while unsafe { rcl_context_is_valid(&mut *node.context.lock() as _) } {
5960
if let Some(error) = spin_once(node, None).err() {
6061
match error {
6162
RclReturnCode::Timeout => continue,

0 commit comments

Comments
 (0)