diff --git a/libraries/core/src/build/git.rs b/libraries/core/src/build/git.rs index c6bca987aa..f926f831ba 100644 --- a/libraries/core/src/build/git.rs +++ b/libraries/core/src/build/git.rs @@ -103,7 +103,7 @@ impl GitManager { "the build directory is still in use by the following \ dataflows, please stop them before rebuilding: {}", using.iter().join(", ") - ) + ); } let reuse = if self.clone_dir_ready(session_id, &clone_dir) { @@ -293,7 +293,7 @@ impl GitFolder { .log_message(LogLevel::Error, format!("{err:?}")) .await; cleanup_failed_clone(logger, &target_dir).await; - bail!(err) + bail!(err); } } } @@ -345,7 +345,7 @@ impl GitFolder { Ok(()) => target_dir, Err(err) => { cleanup_failed_clone(logger, &target_dir).await; - bail!(err) + bail!(err); } } } @@ -379,7 +379,7 @@ impl GitFolder { Ok(()) => target_dir, Err(err) => { cleanup_failed_clone(logger, &target_dir).await; - bail!(err) + bail!(err); } } } @@ -432,12 +432,14 @@ impl GitFolder { // in-progress set only covers one GitManager and the CLI // builds with its own, so deleting here is how #2711 // wipes out a live build. Fail loudly, leave the dir. - Err(err) => bail!( - "couldn't verify clone dir {} is on commit {commit_hash}: {err:?}; \ - leaving it in place in case another build is writing it, \ - please retry", - dir.display() - ), + Err(err) => { + bail!( + "couldn't verify clone dir {} is on commit {commit_hash}: {err:?}; \ + leaving it in place in case another build is writing it, \ + please retry", + dir.display() + ); + } } } diff --git a/libraries/core/src/descriptor/expand.rs b/libraries/core/src/descriptor/expand.rs index 14b5f29eaa..81eab2a4f0 100644 --- a/libraries/core/src/descriptor/expand.rs +++ b/libraries/core/src/descriptor/expand.rs @@ -693,10 +693,12 @@ fn rewrite_module_input( })) } None if optional_inputs.contains(&port_name) => Ok(None), - None => bail!( - "module input reference `_mod/{}` not found in module node inputs", - port_name, - ), + None => { + bail!( + "module input reference `_mod/{}` not found in module node inputs", + port_name, + ); + } } } else if inner_node_ids.contains(&source_str) { // Internal cross-reference: prefix with module_id diff --git a/libraries/core/src/descriptor/mod.rs b/libraries/core/src/descriptor/mod.rs index 7e9b4a13af..cb921a8fe8 100644 --- a/libraries/core/src/descriptor/mod.rs +++ b/libraries/core/src/descriptor/mod.rs @@ -355,7 +355,7 @@ fn node_kind_mut(node: &mut Node) -> eyre::Result> { "module node `{}` must be expanded before resolution — \ call expand_modules() first", node.id - ) + ); } NodeKind::Standard(_) => { let source = match (&node.git, &node.branch, &node.tag, &node.rev) { @@ -369,7 +369,7 @@ fn node_kind_mut(node: &mut Node) -> eyre::Result> { other @ (_, _, _) => { eyre::bail!( "only one of `branch`, `tag`, and `rev` are allowed (got {other:?})" - ) + ); } }; NodeSource::GitBranch { @@ -378,7 +378,7 @@ fn node_kind_mut(node: &mut Node) -> eyre::Result> { } } (None, _, _, _) => { - eyre::bail!("`git` source required when using branch, tag, or rev") + eyre::bail!("`git` source required when using branch, tag, or rev"); } }; @@ -454,7 +454,7 @@ pub fn resolve_path(source: &str, working_dir: &Path) -> Result { } else if let Ok(abs_path) = which::which(&path) { Ok(abs_path) } else { - bail!("Could not find source path {}", path.display()) + bail!("Could not find source path {}", path.display()); } } @@ -500,7 +500,7 @@ pub fn resolve_path_confined( python_env_dir .map(|env| format!(" or its managed environment `{}`", env.display())) .unwrap_or_default(), - ) + ); } /// Canonicalize `candidate` and require it to stay under `root`. @@ -605,7 +605,7 @@ impl NodeExt for Node { eyre::bail!( "node `{}` requires a `path`, `custom`, `operators`, `ros2`, or `module` field", self.id - ) + ); } (None, None, None, Some(operator), None, None) => Ok(NodeKind::Operator(operator)), (None, None, Some(custom), None, None, None) => Ok(NodeKind::Custom(custom)), @@ -617,7 +617,7 @@ impl NodeExt for Node { eyre::bail!( "node `{}` has multiple exclusive fields set, only one of `path`, `custom`, `operators`, `operator`, `ros2`, and `module` is allowed", self.id - ) + ); } } } diff --git a/libraries/core/src/descriptor/validate.rs b/libraries/core/src/descriptor/validate.rs index c30fa9c7c4..6e4ad05312 100644 --- a/libraries/core/src/descriptor/validate.rs +++ b/libraries/core/src/descriptor/validate.rs @@ -425,7 +425,9 @@ fn parse_byte_size(s: &str) -> eyre::Result { "KB" | "K" => 1024, "MB" | "M" => 1024 * 1024, "GB" | "G" => 1024 * 1024 * 1024, - _ => bail!("unknown byte size unit: '{unit}', expected B, KB, MB, or GB"), + _ => { + bail!("unknown byte size unit: '{unit}', expected B, KB, MB, or GB"); + } }; // Use integer parse when possible to avoid float rounding if let Ok(num) = num_str.parse::() { @@ -472,9 +474,11 @@ fn parse_log_level(s: &str) -> eyre::Result Ok(dora_message::common::LogLevelOrStdout::Stdout), - _ => bail!( - "invalid min_log_level: '{s}', expected one of: error, warn, info, debug, trace, stdout" - ), + _ => { + bail!( + "invalid min_log_level: '{s}', expected one of: error, warn, info, debug, trace, stdout" + ); + } } } @@ -565,7 +569,7 @@ assert dora.__version__=='{VERSION}', 'Python dora-rs should be {VERSION}, but .wrap_err("Could not get exit status when checking python dora-rs")?; if !status.success() { - bail!("Something went wrong with Python dora-rs. {reinstall_command}") + bail!("Something went wrong with Python dora-rs. {reinstall_command}"); } Ok(()) @@ -757,19 +761,23 @@ fn validate_ros2_qos( if let Some(d) = &qos.durability { match d.as_str() { "volatile" | "transient_local" => {} - _ => bail!( - "node `{node_id}`: invalid QoS durability `{d}`, \ - expected \"volatile\" or \"transient_local\"" - ), + _ => { + bail!( + "node `{node_id}`: invalid QoS durability `{d}`, \ + expected \"volatile\" or \"transient_local\"" + ); + } } } if let Some(l) = &qos.liveliness { match l.as_str() { "automatic" | "manual_by_participant" | "manual_by_topic" => {} - _ => bail!( - "node `{node_id}`: invalid QoS liveliness `{l}`, \ - expected \"automatic\", \"manual_by_participant\", or \"manual_by_topic\"" - ), + _ => { + bail!( + "node `{node_id}`: invalid QoS liveliness `{l}`, \ + expected \"automatic\", \"manual_by_participant\", or \"manual_by_topic\"" + ); + } } } if let Some(depth) = qos.keep_last