From 1b278d4956b72ff53dc9ca28ba815d66061150b0 Mon Sep 17 00:00:00 2001 From: Jake Runzer Date: Sat, 26 Oct 2024 14:54:27 -0400 Subject: [PATCH] lint fix for a rust update (#1209) --- src/providers/cobol.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/providers/cobol.rs b/src/providers/cobol.rs index 680c4e9ba..ce78ff3c4 100644 --- a/src/providers/cobol.rs +++ b/src/providers/cobol.rs @@ -90,13 +90,10 @@ impl CobolProvider { } fn normalized_path(path: &PathBuf) -> Option { - if let Some(normalized_path) = path.to_slash() { - let path_string = PathBuf::from_str(normalized_path.to_string().as_str()); - - if let Ok(path) = path_string { - return Some(path); - } - } - None + path.to_slash().and_then(|normalized_path| { + PathBuf::from_str(normalized_path.as_ref()) + .map(Some) + .unwrap_or(None) + }) } }