diff --git a/lib/src/conflicts.rs b/lib/src/conflicts.rs index ee7375d89..c1b29362b 100644 --- a/lib/src/conflicts.rs +++ b/lib/src/conflicts.rs @@ -54,7 +54,10 @@ impl Conflict { /// Create a `Conflict` from a `removes` and `adds`, padding with `None` to /// make sure that there is exactly one more `adds` than `removes`. - pub fn from_legacy_form(removes: Vec, adds: Vec) -> Conflict> { + pub fn from_legacy_form( + removes: impl IntoIterator, + adds: impl IntoIterator, + ) -> Conflict> { let mut removes = removes.into_iter().map(Some).collect_vec(); let mut adds = adds.into_iter().map(Some).collect_vec(); while removes.len() + 1 < adds.len() { @@ -196,12 +199,8 @@ impl Conflict> { /// Create a `Conflict` from a `backend::Conflict`, padding with `None` to /// make sure that there is exactly one more `adds()` than `removes()`. pub fn from_backend_conflict(conflict: backend::Conflict) -> Self { - let removes = conflict - .removes - .into_iter() - .map(|term| term.value) - .collect(); - let adds = conflict.adds.into_iter().map(|term| term.value).collect(); + let removes = conflict.removes.into_iter().map(|term| term.value); + let adds = conflict.adds.into_iter().map(|term| term.value); Conflict::from_legacy_form(removes, adds) }