Skip to content

Commit

Permalink
rewrite: build Vec instances directly
Browse files Browse the repository at this point in the history
`[].to_vec()` looks like a manual implementation of `vec![]`.
  • Loading branch information
samueltardieu committed Oct 16, 2024
1 parent 9e80d0c commit ed228ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ pub fn move_commits(
if let Some(parent_ids) = target_commits_external_parents.get(parent_id) {
parent_ids.iter().cloned().collect_vec()
} else {
[parent_id.clone()].to_vec()
vec![parent_id.clone()]
}
})
.collect();
Expand Down Expand Up @@ -638,7 +638,7 @@ pub fn move_commits(
if let Some(children) = target_commit_external_descendants.get(child.id()) {
children.iter().cloned().collect_vec()
} else {
[child.clone()].to_vec()
vec![child.clone()]
}
})
.collect()
Expand Down

0 comments on commit ed228ba

Please sign in to comment.