Skip to content

Commit 32a0516

Browse files
committed
Conform to clippy style guide
Signed-off-by: Michael X. Grey <[email protected]>
1 parent 20e0524 commit 32a0516

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rclrs/src/subscription.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ where
272272
}
273273

274274
fn execute(&self) -> Result<(), RclrsError> {
275-
// Immediately evaluated closure, to handle SubscriptionTakeFailed
276-
// outside this match
277-
match (|| {
275+
let evaluate = || {
278276
match &mut *self.callback.lock().unwrap() {
279277
AnySubscriptionCallback::Regular(cb) => {
280278
let (msg, _) = self.take()?;
@@ -302,7 +300,11 @@ where
302300
}
303301
}
304302
Ok(())
305-
})() {
303+
};
304+
305+
// Immediately evaluated closure, to handle SubscriptionTakeFailed
306+
// outside this match
307+
match evaluate() {
306308
Err(RclrsError::RclError {
307309
code: RclReturnCode::SubscriptionTakeFailed,
308310
..

0 commit comments

Comments
 (0)