added get_at_point back to set.rs and added Eq derives
This commit is contained in:
parent
f0cbe5dc7c
commit
6eb6d8dd2b
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -114,7 +114,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "range_bounds_map"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"btree_monstrousity",
|
||||
"either",
|
||||
|
@ -135,7 +135,7 @@ use crate::TryFromBounds;
|
||||
///
|
||||
/// [`RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html
|
||||
/// [`BTreeMap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct RangeBoundsMap<I, K, V> {
|
||||
inner: BTreeMap<K, V>,
|
||||
phantom: PhantomData<I>,
|
||||
|
@ -25,7 +25,7 @@ use crate::{
|
||||
/// See [`RangeBoundsMap`] for more details.
|
||||
///
|
||||
/// [`RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct RangeBoundsSet<I, K> {
|
||||
inner: RangeBoundsMap<I, K, ()>,
|
||||
}
|
||||
@ -66,6 +66,10 @@ where
|
||||
{
|
||||
self.inner.overlapping(range).map(first)
|
||||
}
|
||||
/// See [`RangeBoundsMap::get_at_point()`] for more details.
|
||||
pub fn get_at_point(&self, point: I) -> Option<K> {
|
||||
self.inner.get_entry_at_point(point).map(first).copied()
|
||||
}
|
||||
/// See [`RangeBoundsMap::contains_point()`] for more details.
|
||||
pub fn contains_point(&self, point: I) -> bool {
|
||||
self.inner.contains_point(point)
|
||||
|
Loading…
x
Reference in New Issue
Block a user