fixed more wrong replacements
This commit is contained in:
@@ -34,7 +34,7 @@ assert_eq!(map.contains_point(20), false);
|
||||
assert_eq!(map.contains_point(5), true);
|
||||
```
|
||||
|
||||
## Example using a custom [`DiscreteRange`] type
|
||||
## Example using a custom range type
|
||||
|
||||
```rust
|
||||
use range_bounds_map::test_ranges::ie;
|
||||
@@ -178,10 +178,13 @@ The aim for this library was to become a more generic superset of
|
||||
[`rangemap`], following from [this
|
||||
issue](https://github.com/jeffparsons/rangemap/issues/56) and [this
|
||||
pull request](https://github.com/jeffparsons/rangemap/pull/57) in
|
||||
which I changed [`rangemap`]'s [`RangeMap`] to use [`DiscreteRange`]s as
|
||||
which I changed [`rangemap`]'s [`RangeMap`] to use [`RangeBounds`]s as
|
||||
keys before I realized it might be easier and simpler to just write it
|
||||
all from scratch.
|
||||
|
||||
It is however worth noting the library eventually expanded and evolved
|
||||
from it's origins.
|
||||
|
||||
# Similar Crates
|
||||
|
||||
Here are some relevant crates I found whilst searching around the
|
||||
@@ -214,8 +217,6 @@ topic area:
|
||||
|
||||
[`btreemap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
|
||||
[`btreeset`]: https://doc.rust-lang.org/std/collections/struct.BTreeSet.html
|
||||
[`start_bound()`]: https://doc.rust-lang.org/std/ops/trait.DiscreteRange.html#tymethod.start_bound
|
||||
[`end_bound()`]: https://doc.rust-lang.org/std/ops/trait.DiscreteRange.html#tymethod.end_bound
|
||||
[`range`]: https://doc.rust-lang.org/std/ops/struct.Range.html
|
||||
[`range()`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.range
|
||||
[`rangemap`]: https://docs.rs/rangemap/latest/rangemap/
|
||||
|
||||
@@ -35,11 +35,11 @@ use crate::utils::{cmp_point_with_range, cut_range, is_valid_range, overlaps};
|
||||
|
||||
/// An ordered map of non-overlapping ranges based on [`BTreeMap`].
|
||||
///
|
||||
/// `I` is the generic type parameter for the [`Ord`] type the `K` type
|
||||
/// is [`DiscreteRange`] over.
|
||||
/// `I` is the generic type parameter for the [`Ord`] type the `K`
|
||||
/// type is a range over.
|
||||
///
|
||||
/// `K` is the generic type parameter for the [`DiscreteRange`]
|
||||
/// implementing type stored as the keys in the map.
|
||||
/// `K` is the generic type parameter for the range type stored as the
|
||||
/// keys in the map.
|
||||
///
|
||||
/// `V` is the generic type parameter for the values associated with the
|
||||
/// keys in the map.
|
||||
@@ -71,7 +71,7 @@ use crate::utils::{cmp_point_with_range, cut_range, is_valid_range, overlaps};
|
||||
/// println!("{range:?}, {value:?}");
|
||||
/// }
|
||||
/// ```
|
||||
/// Example using a custom [`DiscreteRange`] type:
|
||||
/// Example using a custom range type:
|
||||
/// ```
|
||||
/// use range_bounds_map::DiscreteRangeMap;
|
||||
/// use range_bounds_map::FiniteRange;
|
||||
@@ -125,7 +125,6 @@ use crate::utils::{cmp_point_with_range, cut_range, is_valid_range, overlaps};
|
||||
/// );
|
||||
/// ```
|
||||
///
|
||||
/// [`DiscreteRange`]: https://doc.rust-lang.org/std/ops/trait.DiscreteRange.html
|
||||
/// [`BTreeMap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct DiscreteRangeMap<I, K, V> {
|
||||
|
||||
@@ -13,16 +13,14 @@ use crate::{OverlapError, DiscreteRangeMap};
|
||||
/// An ordered set of non-overlapping ranges based on [`DiscreteRangeMap`].
|
||||
///
|
||||
/// `I` is the generic type parameter for the [`Ord`] type the `K`
|
||||
/// type is [`DiscreteRange`] over.
|
||||
/// type is range over.
|
||||
///
|
||||
/// `K` is the generic type parameter for the [`DiscreteRange`]
|
||||
/// implementing type in the set.
|
||||
/// `K` is the generic type parameter for the range implementing type
|
||||
/// in the set.
|
||||
///
|
||||
/// Phrasing it another way: `I` is the point type and `K` is the range type.
|
||||
///
|
||||
/// See [`DiscreteRangeMap`] for more details.
|
||||
///
|
||||
/// [`DiscreteRange`]: https://doc.rust-lang.org/std/ops/trait.DiscreteRange.html
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct DiscreteRangeSet<I, K> {
|
||||
inner: DiscreteRangeMap<I, K, ()>,
|
||||
|
||||
+5
-4
@@ -42,7 +42,7 @@ along with range_bounds_map. If not, see <https://www.gnu.org/licenses/>.
|
||||
//! assert_eq!(map.contains_point(5), true);
|
||||
//! ```
|
||||
//!
|
||||
//! ## Example using a custom [`DiscreteRange`] type
|
||||
//! ## Example using a custom range type
|
||||
//!
|
||||
//! ```rust
|
||||
//! use range_bounds_map::test_ranges::ie;
|
||||
@@ -186,10 +186,13 @@ along with range_bounds_map. If not, see <https://www.gnu.org/licenses/>.
|
||||
//! [`rangemap`], following from [this
|
||||
//! issue](https://github.com/jeffparsons/rangemap/issues/56) and [this
|
||||
//! pull request](https://github.com/jeffparsons/rangemap/pull/57) in
|
||||
//! which I changed [`rangemap`]'s [`RangeMap`] to use [`DiscreteRange`]s as
|
||||
//! which I changed [`rangemap`]'s [`RangeMap`] to use [`RangeBounds`]s as
|
||||
//! keys before I realized it might be easier and simpler to just write it
|
||||
//! all from scratch.
|
||||
//!
|
||||
//! It is however worth noting the library eventually expanded and evolved
|
||||
//! from it's origins.
|
||||
//!
|
||||
//! # Similar Crates
|
||||
//!
|
||||
//! Here are some relevant crates I found whilst searching around the
|
||||
@@ -222,8 +225,6 @@ along with range_bounds_map. If not, see <https://www.gnu.org/licenses/>.
|
||||
//!
|
||||
//! [`btreemap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
|
||||
//! [`btreeset`]: https://doc.rust-lang.org/std/collections/struct.BTreeSet.html
|
||||
//! [`start_bound()`]: https://doc.rust-lang.org/std/ops/trait.DiscreteRange.html#tymethod.start_bound
|
||||
//! [`end_bound()`]: https://doc.rust-lang.org/std/ops/trait.DiscreteRange.html#tymethod.end_bound
|
||||
//! [`range`]: https://doc.rust-lang.org/std/ops/struct.Range.html
|
||||
//! [`range()`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.range
|
||||
//! [`rangemap`]: https://docs.rs/rangemap/latest/rangemap/
|
||||
|
||||
Reference in New Issue
Block a user