Commit 17719924 authored by Benjamin Woodruff's avatar Benjamin Woodruff

re-do constructors to require explicitness when overlapping in a map is desired

parent 757986a7
This diff is collapsed.
This diff is collapsed.
...@@ -307,14 +307,15 @@ where ...@@ -307,14 +307,15 @@ where
V: TaskInput + 'static, V: TaskInput + 'static,
{ {
async fn resolve_input(&self) -> Result<Self> { async fn resolve_input(&self) -> Result<Self> {
let mut new_entries = Vec::new(); let mut new_entries = Vec::with_capacity(self.len());
for (k, v) in self { for (k, v) in self {
new_entries.push(( new_entries.push((
TaskInput::resolve_input(k).await?, TaskInput::resolve_input(k).await?,
TaskInput::resolve_input(v).await?, TaskInput::resolve_input(v).await?,
)); ));
} }
Ok(Self::from(new_entries)) // resolving might deduplicate `Vc`s, we don't want to panic if this happens
Ok(Self::from_overlapping_vec(new_entries))
} }
fn is_resolved(&self) -> bool { fn is_resolved(&self) -> bool {
...@@ -333,11 +334,11 @@ where ...@@ -333,11 +334,11 @@ where
T: TaskInput + Ord + 'static, T: TaskInput + Ord + 'static,
{ {
async fn resolve_input(&self) -> Result<Self> { async fn resolve_input(&self) -> Result<Self> {
let mut new_set = Vec::new(); let mut new_set = Vec::with_capacity(self.len());
for value in self { for value in self {
new_set.push(TaskInput::resolve_input(value).await?); new_set.push(TaskInput::resolve_input(value).await?);
} }
Ok(Self::from(new_set)) Ok(Self::from_iter(new_set))
} }
fn is_resolved(&self) -> bool { fn is_resolved(&self) -> bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment