From 60b35f676ecddafa12e3278a2cc40a509f4707cb Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 25 Jun 2024 09:47:43 +0900 Subject: [PATCH] dag_walk: do one less clone() in heads_ok() --- lib/src/dag_walk.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/dag_walk.rs b/lib/src/dag_walk.rs index a5707fbcb..512d6059a 100644 --- a/lib/src/dag_walk.rs +++ b/lib/src/dag_walk.rs @@ -486,8 +486,7 @@ where II: IntoIterator>, NI: IntoIterator>, { - let start: Vec = start.into_iter().try_collect()?; - let mut heads: HashSet = start.iter().cloned().collect(); + let mut heads: HashSet = start.into_iter().try_collect()?; // Do a BFS until we have only one item left in the frontier. That frontier must // have originated from one of the heads, and since there can't be cycles, // it won't be able to eliminate any other heads.