Clippy fixes

This commit is contained in:
Jeffrey Finkelstein 2023-02-13 21:33:42 -05:00
parent 072335a2ff
commit c6d9d7f11c
3 changed files with 3 additions and 10 deletions

View file

@ -347,7 +347,7 @@ impl<'a, 'b> MDWriter<'a, 'b> {
.trim()
.to_string();
if result != "" {
if !result.is_empty() {
Some(result)
} else {
None

View file

@ -417,7 +417,6 @@ fn test_with_pr_core_utils_tests() {
let value = file_last_modified_time(&scenario, test_file_path);
let mut arguments: Vec<&str> = flags
.split(' ')
.into_iter()
.filter(|i| i.trim() != "")
.collect::<Vec<&str>>();

View file

@ -174,17 +174,12 @@ fn test_verbose_nested_failure() {
#[cfg(unix)]
#[test]
fn test_rmdir_ignore_nonempty_no_permissions() {
use std::fs;
let (at, mut ucmd) = at_and_ucmd!();
// We make the *parent* dir read-only to prevent deleting the dir in it.
at.mkdir_all("dir/ect/ory");
at.touch("dir/ect/ory/file");
let dir_ect = at.plus("dir/ect");
let mut perms = fs::metadata(&dir_ect).unwrap().permissions();
perms.set_readonly(true);
fs::set_permissions(&dir_ect, perms.clone()).unwrap();
at.set_mode("dir/ect", 0o555);
// rmdir should now get a permissions error that it interprets as
// a non-empty error.
@ -196,8 +191,7 @@ fn test_rmdir_ignore_nonempty_no_permissions() {
assert!(at.dir_exists("dir/ect/ory"));
// Politely restore permissions for cleanup
perms.set_readonly(false);
fs::set_permissions(&dir_ect, perms).unwrap();
at.set_mode("dir/ect", 0o755);
}
#[test]