From 5a0aca2fd7c3d7e7699d070a78d948b29f006367 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Sun, 29 Sep 2024 09:39:13 -0700 Subject: [PATCH] use a type for the too-complex return type of the non-ros cli args getter as suggested by clippy --- mcap_tools/src/mcap_play.rs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/mcap_tools/src/mcap_play.rs b/mcap_tools/src/mcap_play.rs index 4c491b6..fd9ea2a 100644 --- a/mcap_tools/src/mcap_play.rs +++ b/mcap_tools/src/mcap_play.rs @@ -177,19 +177,15 @@ async fn mcap_playback_init( Ok((pubs, tf_static_aggregated, msg_t0, msg_t1)) } -fn get_non_ros_cli_args( - unused_args: Vec, -) -> Result< - ( - Option, - bool, - Option, - Option, - f64, - Vec, - ), - anyhow::Error, -> { +type PlayArgs = ( + Option, + bool, + (Option, Option), + f64, + Vec, +); + +fn get_non_ros_cli_args(unused_args: Vec) -> Result { let matches = command!() .arg( arg!( @@ -268,8 +264,7 @@ fn get_non_ros_cli_args( Ok(( max_loops, publish_clock, - include_re, - exclude_re, + (include_re, exclude_re), start_secs_offset, mcap_names, )) @@ -295,7 +290,7 @@ async fn main() -> Result<(), anyhow::Error> { let master_uri = std::env::var("ROS_MASTER_URI").unwrap_or("http://localhost:11311".to_string()); - let (max_loops, publish_clock, include_re, exclude_re, start_secs_offset, mcap_names) = + let (max_loops, publish_clock, (include_re, exclude_re), start_secs_offset, mcap_names) = get_non_ros_cli_args(unused_args)?; // Setup a task to kill this process when ctrl_c comes in: