@@ -17,7 +17,7 @@ use std::collections::VecDeque;
1717// for containers that implement `Default`, and we use the associated `::Container` all over Timely.
1818// We can only access the type if all requirements for the `ContainerBuilder` implementation are
1919// satisfied.
20- pub trait WithProgress : Default {
20+ pub trait WithProgress {
2121 /// The number of updates
2222 ///
2323 /// This number is used in progress tracking to confirm the receipt of some number
@@ -52,7 +52,7 @@ pub trait DrainContainer {
5252}
5353
5454/// A container that can be sized and reveals its capacity.
55- pub trait SizableContainer : WithProgress {
55+ pub trait SizableContainer : Sized {
5656 /// Indicates that the container is "full" and should be shipped.
5757 fn at_capacity ( & self ) -> bool ;
5858 /// Restores `self` to its desired capacity, if it has one.
@@ -96,7 +96,7 @@ pub trait ContainerBuilder: Default + 'static {
9696 /// The container type we're building.
9797 // The container is `Clone` because `Tee` requires it, otherwise we need to repeat it
9898 // all over Timely. `'static` because we don't want lifetimes everywhere.
99- type Container : WithProgress + Clone + ' static ;
99+ type Container : WithProgress + Default + Clone + ' static ;
100100 /// Extract assembled containers, potentially leaving unfinished data behind. Can
101101 /// be called repeatedly, for example while the caller can send data.
102102 ///
@@ -152,7 +152,7 @@ pub struct CapacityContainerBuilder<C>{
152152 pending : VecDeque < C > ,
153153}
154154
155- impl < T , C : SizableContainer + PushInto < T > > PushInto < T > for CapacityContainerBuilder < C > {
155+ impl < T , C : SizableContainer + Default + PushInto < T > > PushInto < T > for CapacityContainerBuilder < C > {
156156 #[ inline]
157157 fn push_into ( & mut self , item : T ) {
158158 // Ensure capacity
@@ -168,7 +168,7 @@ impl<T, C: SizableContainer + PushInto<T>> PushInto<T> for CapacityContainerBuil
168168 }
169169}
170170
171- impl < C : WithProgress + Clone + ' static > ContainerBuilder for CapacityContainerBuilder < C > {
171+ impl < C : WithProgress + Default + Clone + ' static > ContainerBuilder for CapacityContainerBuilder < C > {
172172 type Container = C ;
173173
174174 #[ inline]
@@ -191,7 +191,7 @@ impl<C: WithProgress + Clone + 'static> ContainerBuilder for CapacityContainerBu
191191 }
192192}
193193
194- impl < C : WithProgress + Clone + ' static > LengthPreservingContainerBuilder for CapacityContainerBuilder < C > { }
194+ impl < C : WithProgress + SizableContainer + Default + Clone + ' static > LengthPreservingContainerBuilder for CapacityContainerBuilder < C > { }
195195
196196impl < T > WithProgress for Vec < T > {
197197 #[ inline] fn update_count ( & self ) -> i64 { i64:: try_from ( Vec :: len ( self ) ) . unwrap ( ) }
0 commit comments