Skip to content

Commit 679e939

Browse files
authored
Remove push_container from capacity container builder (#623)
Remove the `push_container` function from the `CapacityContainerBuilder`. It's not used anymore since we implemented `give_container` support for all sessions. Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
1 parent ec97bc2 commit 679e939

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

container/src/lib.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -194,27 +194,6 @@ impl<C: Container + Clone + 'static> ContainerBuilder for CapacityContainerBuild
194194

195195
impl<C: Container + Clone + 'static> LengthPreservingContainerBuilder for CapacityContainerBuilder<C> { }
196196

197-
impl<C: Container> CapacityContainerBuilder<C> {
198-
/// Push a pre-formed container at this builder. This exists to maintain
199-
/// API compatibility.
200-
#[inline]
201-
pub fn push_container(&mut self, container: &mut C) {
202-
if !container.is_empty() {
203-
// Flush to maintain FIFO ordering.
204-
if self.current.len() > 0 {
205-
self.pending.push_back(std::mem::take(&mut self.current));
206-
}
207-
208-
let mut empty = self.empty.take().unwrap_or_default();
209-
// Ideally, we'd discard non-uniformly sized containers, but we don't have
210-
// access to `len`/`capacity` of the container.
211-
empty.clear();
212-
213-
self.pending.push_back(std::mem::replace(container, empty));
214-
}
215-
}
216-
}
217-
218197
impl<T> Container for Vec<T> {
219198
type ItemRef<'a> = &'a T where T: 'a;
220199
type Item<'a> = T where T: 'a;

0 commit comments

Comments
 (0)