diff --git a/process/logging.rs b/process/logging.rs index b6d362c..28e08e2 100644 --- a/process/logging.rs +++ b/process/logging.rs @@ -439,9 +439,8 @@ where // Split the reference by colon to separate the tag or digest let mut parts = text.split(':'); - let path = match parts.next() { - None => return text.to_string(), - Some(path) => path, + let Some(path) = parts.next() else { + return text.to_string(); }; let tag = parts.next(); diff --git a/src/commands/bug_report.rs b/src/commands/bug_report.rs index a8c10bf..48b0a8d 100644 --- a/src/commands/bug_report.rs +++ b/src/commands/bug_report.rs @@ -123,7 +123,7 @@ impl BugReportCommand { Ok(()) } - fn get_recipe(&self) -> Option { + fn get_recipe(&self) -> Option> { let recipe_path = self.recipe_path.clone().unwrap_or_else(|| { get_config_file("recipe", "Enter path to recipe file").unwrap_or_else(|_| { trace!("Failed to get recipe"); diff --git a/src/commands/validate/yaml_span.rs b/src/commands/validate/yaml_span.rs index 5511e1f..162bd23 100644 --- a/src/commands/validate/yaml_span.rs +++ b/src/commands/validate/yaml_span.rs @@ -88,15 +88,12 @@ where let mut stream_start = false; let mut document_start = false; - let key = match self.path.next() { - None => { - let (_, marker) = self - .events - .find(|(e, _)| matches!(e, Event::StreamStart)) - .unwrap(); - return Ok((marker.index(), 1).into()); - } - Some(key) => key, + let Some(key) = self.path.next() else { + let (_, marker) = self + .events + .find(|(e, _)| matches!(e, Event::StreamStart)) + .unwrap(); + return Ok((marker.index(), 1).into()); }; Ok(loop {