Skip to content

Commit

Permalink
style(clippy): clippy auto-fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gibfahn committed Nov 29, 2023
1 parent 7936dbb commit b09a38f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/generate/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn parse_git_config(
sorted_remote_names.push(remote_names.remove(pos));
}
}
sorted_remote_names.extend(remote_names.into_iter());
sorted_remote_names.extend(remote_names);
}

let mut remotes = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/defaults/plist_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ fn replace_ellipsis_array(new_value: &mut plist::Value, old_value: Option<&plist
return;
};

let array_copy: Vec<_> = array.drain(..).collect();
let array_copy: Vec<_> = std::mem::take(array);

trace!("Performing array ellipsis replacement...");
for element in array_copy {
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/git/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub(crate) fn real_update(git_config: &GitConfig) -> Result<bool> {
);

// The first remote specified is the default remote.
let default_remote_name = git_config.remotes.get(0).ok_or(E::NoRemotes)?.name.clone();
let default_remote_name = git_config.remotes.first().ok_or(E::NoRemotes)?.name.clone();
let mut default_remote =
repo.find_remote(&default_remote_name)
.map_err(|e| E::RemoteNotFound {
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub(crate) fn run(config: LinkOptions, up_dir: &Utf8Path) -> Result<TaskStatus>
}

Err(e) => warn!("Backup dir {backup_dir} non-empty, check contents: {e:?}"),
Ok(_) => (),
Ok(()) => (),
}

debug!(
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl Task {

let output = cmd_log(
Level::Debug,
cmd.get(0).ok_or(E::EmptyCmd)?,
cmd.first().ok_or(E::EmptyCmd)?,
cmd.get(1..).unwrap_or(&[]),
)
.dir(task_tempdir)
Expand All @@ -292,7 +292,7 @@ impl Task {
let suggestion = match e.kind() {
std::io::ErrorKind::PermissionDenied => format!(
"\n Suggestion: Try making the file executable with `chmod +x {path}`",
path = cmd.get(0).map_or("", String::as_str)
path = cmd.first().map_or("", String::as_str)
),
_ => String::new(),
};
Expand Down

0 comments on commit b09a38f

Please sign in to comment.