rewrite: build Vec instances directly

`[].to_vec()` looks like a manual implementation of `vec![]`.
This commit is contained in:
Samuel Tardieu 2024-10-16 23:27:19 +02:00
parent 9e80d0c51d
commit 33f9b89350

View file

@ -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();
@ -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()