Clippy lint: Collapse nested if
@@ -76,8 +76,7 @@ pub fn remove_pred<'a>(
let name = entry.name().ok_or(super::josh_error("INVALID_FILENAME"))?;
let path = std::path::PathBuf::from(root).join(name);
- if entry.kind() == Some(git2::ObjectType::Blob) {
- if pred(&path, true) {
+ if entry.kind() == Some(git2::ObjectType::Blob) && pred(&path, true) {
result = replace_child(
&repo,
&std::path::Path::new(entry.name().ok_or(super::josh_error("no name"))?),
@@ -86,7 +85,6 @@ pub fn remove_pred<'a>(
&result,
)?;
}
- }
if entry.kind() == Some(git2::ObjectType::Tree) {
let s = if (root != "") && pred(&path, false) {
