From 98a9c1bdec831d527d8bb90950c414cc5a450208 Mon Sep 17 00:00:00 2001 From: Yury Antonov <1390348+yantonov@users.noreply.github.com> Date: Sun, 3 Nov 2024 20:53:07 +0100 Subject: [PATCH] remove unnecessary return statements --- src/environment/autodetect_executable.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/environment/autodetect_executable.rs b/src/environment/autodetect_executable.rs index 4a4766d..db2c364 100644 --- a/src/environment/autodetect_executable.rs +++ b/src/environment/autodetect_executable.rs @@ -58,8 +58,8 @@ impl FileSystemWrapper for OsFileSystemWrapper { fn is_file(&self, path: &Path) -> bool { let metadata = std::fs::symlink_metadata(path); - return metadata.map(|x| x.is_file()) - .unwrap_or(false); + metadata.map(|x| x.is_file()) + .unwrap_or(false) } } @@ -78,15 +78,15 @@ mod tests { impl TestFileDescriptor { pub fn file() -> TestFileDescriptor { - return TestFileDescriptor { + TestFileDescriptor { is_file: true - }; + } } pub fn symlink() -> TestFileDescriptor { - return TestFileDescriptor { + TestFileDescriptor { is_file: false - }; + } } } @@ -96,9 +96,9 @@ mod tests { impl TestFileSystemWrapper { pub fn create() -> TestFileSystemWrapper { - return TestFileSystemWrapper { + TestFileSystemWrapper { path_to_descriptor: HashMap::new() - }; + } } pub fn add(&mut self, path: &str, descriptor: &TestFileDescriptor) { @@ -112,9 +112,9 @@ mod tests { } fn is_file(&self, path: &Path) -> bool { - return self.path_to_descriptor.get(path.to_str().unwrap()) + self.path_to_descriptor.get(path.to_str().unwrap()) .map(|d| d.is_file) - .unwrap_or(false); + .unwrap_or(false) } }