diff --git a/container/Cargo.toml b/container/Cargo.toml index 0897b19da..470172198 100644 --- a/container/Cargo.toml +++ b/container/Cargo.toml @@ -7,5 +7,5 @@ license = "MIT" [dependencies] columnation = { git = "https://github.com/frankmcsherry/columnation" } -flatcontainer = "0.3" +flatcontainer = "0.4" serde = { version = "1.0"} diff --git a/container/src/columnation.rs b/container/src/columnation.rs index 7fe1ffe83..f2a7b4bdc 100644 --- a/container/src/columnation.rs +++ b/container/src/columnation.rs @@ -401,7 +401,8 @@ mod flatcontainer { } } - impl Region for ColumnationRegion { + impl Region for ColumnationRegion { + type Owned = T; type ReadItem<'a> = &'a T where Self: 'a; type Index = usize; @@ -426,30 +427,34 @@ mod flatcontainer { fn heap_size(&self, callback: F) { self.inner.heap_size(callback); } + + fn reborrow<'b, 'a: 'b>(item: Self::ReadItem<'a>) -> Self::ReadItem<'b> where Self: 'a { + item + } } - impl Push for ColumnationRegion { + impl Push for ColumnationRegion { fn push(&mut self, item: T) -> Self::Index { self.inner.copy(&item); self.inner.len() - 1 } } - impl Push<&T> for ColumnationRegion { + impl Push<&T> for ColumnationRegion { fn push(&mut self, item: &T) -> Self::Index { self.inner.copy(item); self.inner.len() - 1 } } - impl Push<&&T> for ColumnationRegion { + impl Push<&&T> for ColumnationRegion { fn push(&mut self, item: &&T) -> Self::Index { self.inner.copy(*item); self.inner.len() - 1 } } - impl<'a, T: Columnation + 'a> ReserveItems<&'a T> for ColumnationRegion { + impl<'a, T: Columnation + Clone + 'a> ReserveItems<&'a T> for ColumnationRegion { fn reserve_items(&mut self, items: I) where I: Iterator + Clone { self.inner.reserve_items(items); }