From d4647e5ec62a3bf9d21af251337cc9f8da5cc7a7 Mon Sep 17 00:00:00 2001 From: ripytide Date: Fri, 21 Apr 2023 14:48:45 +0100 Subject: [PATCH] update wrong replacements --- README.md | 13 +++++++------ rustfmt.toml | 4 ++-- src/discrete_range_map.rs | 8 +++----- src/discrete_range_set.rs | 2 +- src/lib.rs | 13 +++++++------ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index ce1f3fa..1e588dd 100644 --- a/README.md +++ b/README.md @@ -108,8 +108,9 @@ value `6.5` exists. ### Finite-ness This crate is also designed to work with [`Finite`] types since it is -much easy to implement and it is not restrictive to users since you -can still represent `Infinite` numbers in `Finite` types paradoxically. +much easier to implement and it is not restrictive to users since you +can still represent `Infinite` numbers in `Finite` types paradoxically +using the concept of [`Actual Infinity`]. For example you could define `Infinite` for `u8` as `u8::MAX` or if you still want to use `u8::MAX` as a `Finite` number you could define @@ -201,10 +202,10 @@ topic area: for [`Range`]s and not [`RangeInclusive`]s. And also no fancy merging functions. - - A data structure based off of a 2007 published paper! It supports any - DiscreteRange as keys too, except it is implemented with a non-balancing - `Box` based tree, however it also supports overlapping - DiscreteRange which my library does not. + A data structure based off of a 2007 published paper! It supports + any range as keys, unfortunately, it is implemented with a + non-balancing `Box` based tree, however it also supports + overlapping ranges which my library does not. - I'm not entirely sure what this library is or isn't, but it looks like a custom red-black tree/BTree implementation used specifically for a diff --git a/rustfmt.toml b/rustfmt.toml index 0da0890..824fbfe 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,9 +1,9 @@ # todo this file put back to normal -# - rename DiscreteRange{Set,Map} to DiscreteRange{Set,Map} + # - rename crate too # - add link to previous crate on readme # - update shared descriptions to note the discreteness -# - fix doc.rs rs in docs to print at new crate name +# - fix doc.rs links in docs to print at new crate name # - fix doc warnings hard_tabs=true imports_granularity="Module" diff --git a/src/discrete_range_map.rs b/src/discrete_range_map.rs index 81dbacb..af57fa9 100644 --- a/src/discrete_range_map.rs +++ b/src/discrete_range_map.rs @@ -746,7 +746,7 @@ where .map(|(key, _)| (key.start(), key.end())); // If the start or end point of outer_range is not - // contained within a DiscreteRange in the map then we need to + // contained within a range in the map then we need to // generate the gaps. let start_gap = (!self .inner @@ -1455,9 +1455,7 @@ where } } -/// A simple helper trait to make my implemtation nicer, if you -/// already implement DiscreteRange and Copy on your type then this will -/// also be implemted. +/// A range that has Finite **Inclusive** end-points. pub trait FiniteRange { fn start(&self) -> I; fn end(&self) -> I; @@ -1564,7 +1562,7 @@ where let mut map = DiscreteRangeMap::new(); while let Some((range_bounds, value)) = access.next_entry()? { map.insert_strict(range_bounds, value) - .map_err(|_| serde::de::Error::custom("DiscreteRange overlap"))?; + .map_err(|_| serde::de::Error::custom("ranges overlap"))?; } Ok(map) } diff --git a/src/discrete_range_set.rs b/src/discrete_range_set.rs index 66597cd..d2c199e 100644 --- a/src/discrete_range_set.rs +++ b/src/discrete_range_set.rs @@ -256,7 +256,7 @@ where let mut set = DiscreteRangeSet::new(); while let Some(range_bounds) = access.next_element()? { set.insert_strict(range_bounds) - .map_err(|_| serde::de::Error::custom("DiscreteRange overlap"))?; + .map_err(|_| serde::de::Error::custom("ranges overlap"))?; } Ok(set) } diff --git a/src/lib.rs b/src/lib.rs index 88fdeda..ab6cda8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,8 +116,9 @@ along with range_bounds_map. If not, see . //! ### Finite-ness //! //! This crate is also designed to work with [`Finite`] types since it is -//! much easy to implement and it is not restrictive to users since you -//! can still represent `Infinite` numbers in `Finite` types paradoxically. +//! much easier to implement and it is not restrictive to users since you +//! can still represent `Infinite` numbers in `Finite` types paradoxically +//! using the concept of [`Actual Infinity`]. //! //! For example you could define `Infinite` for `u8` as `u8::MAX` or if //! you still want to use `u8::MAX` as a `Finite` number you could define @@ -209,10 +210,10 @@ along with range_bounds_map. If not, see . //! for [`Range`]s and not [`RangeInclusive`]s. And also no fancy //! merging functions. //! - -//! A data structure based off of a 2007 published paper! It supports any -//! DiscreteRange as keys too, except it is implemented with a non-balancing -//! `Box` based tree, however it also supports overlapping -//! DiscreteRange which my library does not. +//! A data structure based off of a 2007 published paper! It supports +//! any range as keys, unfortunately, it is implemented with a +//! non-balancing `Box` based tree, however it also supports +//! overlapping ranges which my library does not. //! - //! I'm not entirely sure what this library is or isn't, but it looks like //! a custom red-black tree/BTree implementation used specifically for a