diff --git a/data-model/src/grouping/area.rs b/data-model/src/grouping/area.rs index 10b5b0a..66c2289 100644 --- a/data-model/src/grouping/area.rs +++ b/data-model/src/grouping/area.rs @@ -97,11 +97,6 @@ impl Area { path, }) } - - /// Return a [`Range3d`] with equivalent inclusion to this [`Area`]. - pub fn into_range(&self) -> Range3d { - todo!("Need to add successor fns to SubspaceId and Paths first.") - } } #[cfg(test)] diff --git a/data-model/src/grouping/area_of_interest.rs b/data-model/src/grouping/area_of_interest.rs index 8ca0dc4..335db19 100644 --- a/data-model/src/grouping/area_of_interest.rs +++ b/data-model/src/grouping/area_of_interest.rs @@ -1,6 +1,4 @@ -use crate::{parameters::SubspaceId, path::Path}; - -use super::area::Area; +use crate::{grouping::area::Area, parameters::SubspaceId, path::Path}; /// A grouping of [`Entry`]s that are among the newest in some [`Store`]. /// [Definition](https://willowprotocol.org/specs/grouping-entries/index.html#aois). @@ -21,7 +19,7 @@ impl AreaOfInterest { None => None, Some(area_intersection) => Some(Self { area: area_intersection, - max_count: self.max_count.min(other.max_count), + max_count: core::cmp::min(self.max_count, other.max_count), max_size: self.max_size.min(other.max_size), }), } diff --git a/data-model/src/grouping/range_3d.rs b/data-model/src/grouping/range_3d.rs index d3fd2d9..d0b9d81 100644 --- a/data-model/src/grouping/range_3d.rs +++ b/data-model/src/grouping/range_3d.rs @@ -1,6 +1,6 @@ -use super::range::Range; use crate::{ entry::{Entry, Timestamp}, + grouping::{area::Area, range::Range}, parameters::{NamespaceId, PayloadDigest, SubspaceId}, path::Path, }; @@ -48,13 +48,19 @@ impl Default for Range3d { /// [Definition](https://willowprotocol.org/specs/grouping-entries/index.html#default_3d_range). fn default() -> Self { Self { - subspaces: Default::default(), + subspaces: Range::::default(), paths: Range::new_open(P::empty()), times: Range::new_open(0), } } } +impl From> for Range3d { + fn from(_value: Area) -> Self { + todo!("Need to add successor fns to SubspaceId and Paths first.") + } +} + #[cfg(test)] mod tests { use crate::path::{PathComponent, PathComponentBox, PathRc}; diff --git a/data-model/src/parameters.rs b/data-model/src/parameters.rs index 0bc68e4..97ff6aa 100644 --- a/data-model/src/parameters.rs +++ b/data-model/src/parameters.rs @@ -1,4 +1,4 @@ -use super::{entry::Entry, path::Path}; +use crate::{entry::Entry, path::Path}; /// A type for identifying [namespaces](https://willowprotocol.org/specs/data-model/index.html#namespace). /// [Definition](https://willowprotocol.org/specs/data-model/index.html#NamespaceId). diff --git a/data-model/src/path.rs b/data-model/src/path.rs index 62ef143..a58fc10 100644 --- a/data-model/src/path.rs +++ b/data-model/src/path.rs @@ -181,7 +181,7 @@ impl Path for PathRc