()
| 1596 | }); |
| 1597 | |
| 1598 | THREAD_POOL.depopulate(); |
| 1599 | } |
| 1600 | |
| 1601 | struct Tree<T: Send> { |
| 1602 | value: T, |
| 1603 | children: Vec<Tree<T>>, |
| 1604 | } |
| 1605 | |
| 1606 | impl<T: Send> Tree<T> { |
| 1607 | fn iter(&self) -> vec::IntoIter<&T> { |
| 1608 | once(&self.value) |
| 1609 | .chain(self.children.iter().flat_map(Tree::iter)) |
| 1610 | .collect::<Vec<_>>() // seems like it shouldn't be needed... but prevents overflow |
| 1611 | .into_iter() |
| 1612 | } |
| 1613 | |
| 1614 | fn update<OP>(&mut self, op: OP) |
| 1615 | where |
| 1616 | OP: Fn(&mut T) + Sync, |
| 1617 | T: Send, |
| 1618 | { |
| 1619 | scope(|scope| self.update_in_scope(scope, &op)); |
| 1620 | } |
| 1621 | |
| 1622 | fn update_in_scope<'scope, 'env, OP>( |
| 1623 | &'env mut self, |
nothing calls this directly
no test coverage detected