Skip to content

Commit

Permalink
remove unnecessary return statements
Browse files Browse the repository at this point in the history
  • Loading branch information
yantonov committed Nov 3, 2024
1 parent 3de4689 commit 98a9c1b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/environment/autodetect_executable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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
};
}
}
}

Expand All @@ -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) {
Expand All @@ -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)
}
}

Expand Down

0 comments on commit 98a9c1b

Please sign in to comment.