From 43b345a2bcdca1e698ca8c7cdff8812ba5c23469 Mon Sep 17 00:00:00 2001 From: Nikolai Morin Date: Tue, 11 Oct 2022 10:07:39 +0200 Subject: [PATCH] Fix a segfault when re-using wait set --- rclrs/src/wait.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rclrs/src/wait.rs b/rclrs/src/wait.rs index 09284ed75..9d23a53fa 100644 --- a/rclrs/src/wait.rs +++ b/rclrs/src/wait.rs @@ -321,7 +321,7 @@ impl WaitSet { /// This list is not comprehensive, since further errors may occur in the `rmw` or `rcl` layers. /// /// [1]: std::time::Duration::ZERO - pub fn wait(&mut self, timeout: Option) -> Result { + pub fn wait(self, timeout: Option) -> Result { let timeout_ns = match timeout.map(|d| d.as_nanos()) { None => -1, Some(ns) if ns <= i64::MAX as u128 => ns as i64,