1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-11-25 13:22:17 +03:00

refactor(clippy): apply if_not_else lint (#882)

This commit is contained in:
Nejc Galof 2024-09-25 10:48:36 +02:00 committed by GitHub
parent a344c68238
commit 8b7c20083a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

View File

@ -131,10 +131,10 @@ impl<'a> Changelog<'a> {
.filter_map(|line| {
let mut c = commit.clone();
c.message = line.to_string();
if !c.message.is_empty() {
Self::process_commit(&c, &self.config.git)
} else {
if c.message.is_empty() {
None
} else {
Self::process_commit(&c, &self.config.git)
}
})
.collect()

View File

@ -355,12 +355,12 @@ impl Commit<'_> {
}
}
}
if !filter {
Ok(self)
} else {
if filter {
Err(AppError::GroupError(String::from(
"Commit does not belong to any group",
)))
} else {
Ok(self)
}
}

View File

@ -249,10 +249,10 @@ impl Repository {
return 0;
}
let name = entry.name().expect("failed to get entry name");
let entry_path = if dir != "," {
format!("{dir}/{name}")
} else {
let entry_path = if dir == "," {
name.to_string()
} else {
format!("{dir}/{name}")
};
changed_files.push(entry_path.into());
0