Skip to content

Commit

Permalink
clippy: fix nightly clippy warnings *except* for `needless_raw_string…
Browse files Browse the repository at this point in the history
…_hashes`

This is (almost) a result of running

    cargo +nightly clippy --workspace --all-targets --fix \
      --  -A 'clippy::needless_raw_string_hashes'

with yesterday's nightly clippy.

mitsuhiko/insta#389 causes numerous additional
`needless_raw_string_hashes` warnings, but it will hopefully be fixed soon.
For now, I recommend appending the second line to your invocations.
  • Loading branch information
ilyagr committed Jul 10, 2023
1 parent 9aa308f commit d81c599
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/src/dag_walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ where
{
let start: Vec<T> = start.into_iter().collect();
let mut reachable: HashSet<T> = start.iter().cloned().collect();
for _node in dfs(start.into_iter(), id_fn, |node| {
for _node in dfs(start, id_fn, |node| {
let neighbors: Vec<T> = neighbors_fn(node).into_iter().collect();
for neighbor in &neighbors {
reachable.remove(neighbor);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ pub fn import_some_refs(
// come from branches which were never fetched.
let mut pinned_git_heads_set = HashSet::new();
for heads_for_ref in pinned_git_heads.into_values() {
pinned_git_heads_set.extend(heads_for_ref.into_iter());
pinned_git_heads_set.extend(heads_for_ref);
}
pinned_git_heads_set.retain(|id| mut_repo.index().has_id(id));
// We could use mut_repo.record_rewrites() here but we know we only need to care
Expand Down Expand Up @@ -986,7 +986,7 @@ pub fn parse_gitmodules(
// Partial config value for each submodule name
let mut partial_configs: BTreeMap<String, PartialSubmoduleConfig> = BTreeMap::new();

let entries = git_config.entries(Some(r#"submodule\..+\."#))?;
let entries = git_config.entries(Some(r"submodule\..+\."))?;
entries.for_each(|entry| {
let (config_name, config_value) = match (entry.name(), entry.value()) {
// Reject non-utf8 entries
Expand Down
2 changes: 1 addition & 1 deletion src/commands/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn find_globs(
if names.is_empty() {
failed_globs.push(glob);
}
matching_branches.extend(names.into_iter());
matching_branches.extend(names);
}
match &failed_globs[..] {
[] => { /* No problem */ }
Expand Down

0 comments on commit d81c599

Please sign in to comment.