Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/dense.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct DenseU32RangeMap<V> {

impl<V> DenseU32RangeMap<V>
where
V: Eq + Clone,
V: PartialEq + Clone,
{
pub fn new() -> DenseU32RangeMap<V> {
DenseU32RangeMap {
Expand Down Expand Up @@ -64,7 +64,7 @@ where

impl<V> From<RangeMap<u32, V>> for DenseU32RangeMap<V>
where
V: Eq + Clone,
V: PartialEq + Clone,
{
fn from(range_map: RangeMap<u32, V>) -> Self {
let mut dense = Self::new();
Expand All @@ -84,7 +84,7 @@ where

impl<V> From<RangeInclusiveMap<u32, V>> for DenseU32RangeMap<V>
where
V: Eq + Clone,
V: PartialEq + Clone,
{
fn from(range_inclusive_map: RangeInclusiveMap<u32, V, u32>) -> Self {
let mut dense = Self::new();
Expand All @@ -106,7 +106,7 @@ pub struct Iter<'a, V> {
// Coalesce items from the underlying dense map as we go.
impl<'a, V> Iterator for Iter<'a, V>
where
V: 'a + Eq,
V: 'a + PartialEq,
{
type Item = (RangeInclusive<u32>, &'a V);

Expand Down Expand Up @@ -146,7 +146,7 @@ pub struct EndExclusiveIter<'a, V> {

impl<'a, V> Iterator for EndExclusiveIter<'a, V>
where
V: 'a + Eq,
V: 'a + PartialEq,
{
type Item = (Range<u32>, &'a V);

Expand Down
22 changes: 11 additions & 11 deletions src/inclusive_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where
impl<K, V> quickcheck::Arbitrary for RangeInclusiveMap<K, V>
where
K: quickcheck::Arbitrary + Ord + StepLite,
V: quickcheck::Arbitrary + Eq,
V: quickcheck::Arbitrary + PartialEq,
{
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
// REVISIT: allocation could be avoided if Gen::gen_size were public (https://github.com/BurntSushi/quickcheck/issues/326#issue-2653601170)
Expand All @@ -133,7 +133,7 @@ impl<K, V, StepFnsT> RangeInclusiveMap<K, V, StepFnsT> {
impl<K, V> RangeInclusiveMap<K, V, K>
where
K: Ord + Clone + StepLite,
V: Eq + Clone,
V: PartialEq + Clone,
{
/// Makes a new empty `RangeInclusiveMap`.
#[cfg(feature = "const_fn")]
Expand All @@ -151,7 +151,7 @@ where
impl<K, V, StepFnsT> RangeInclusiveMap<K, V, StepFnsT>
where
K: Ord + Clone,
V: Eq + Clone,
V: PartialEq + Clone,
StepFnsT: StepFns<K>,
{
/// Makes a new empty `RangeInclusiveMap`, specifying successor and
Expand Down Expand Up @@ -690,7 +690,7 @@ impl<K, V> DoubleEndedIterator for IntoIter<K, V> {
impl<K: Debug, V: Debug> Debug for RangeInclusiveMap<K, V>
where
K: Ord + Clone + StepLite,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_map().entries(self.iter()).finish()
Expand All @@ -700,7 +700,7 @@ where
impl<K, V> FromIterator<(RangeInclusive<K>, V)> for RangeInclusiveMap<K, V>
where
K: Ord + Clone + StepLite,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn from_iter<T: IntoIterator<Item = (RangeInclusive<K>, V)>>(iter: T) -> Self {
let mut range_map = RangeInclusiveMap::new();
Expand All @@ -712,7 +712,7 @@ where
impl<K, V> Extend<(RangeInclusive<K>, V)> for RangeInclusiveMap<K, V>
where
K: Ord + Clone + StepLite,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn extend<T: IntoIterator<Item = (RangeInclusive<K>, V)>>(&mut self, iter: T) {
iter.into_iter().for_each(move |(k, v)| {
Expand All @@ -725,7 +725,7 @@ where
impl<K, V> Serialize for RangeInclusiveMap<K, V>
where
K: Ord + Clone + StepLite + Serialize,
V: Eq + Clone + Serialize,
V: PartialEq + Clone + Serialize,
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand All @@ -744,7 +744,7 @@ where
impl<'de, K, V> Deserialize<'de> for RangeInclusiveMap<K, V>
where
K: Ord + Clone + StepLite + Deserialize<'de>,
V: Eq + Clone + Deserialize<'de>,
V: PartialEq + Clone + Deserialize<'de>,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -772,7 +772,7 @@ impl<K, V> RangeInclusiveMapVisitor<K, V> {
impl<'de, K, V> Visitor<'de> for RangeInclusiveMapVisitor<K, V>
where
K: Ord + Clone + StepLite + Deserialize<'de>,
V: Eq + Clone + Deserialize<'de>,
V: PartialEq + Clone + Deserialize<'de>,
{
type Value = RangeInclusiveMap<K, V>;

Expand Down Expand Up @@ -972,7 +972,7 @@ mod tests {
impl<K, V> Arbitrary for RangeInclusiveMap<K, V>
where
K: Ord + Clone + Debug + StepLite + Arbitrary + 'static,
V: Clone + Eq + Arbitrary + 'static,
V: Clone + PartialEq + Arbitrary + 'static,
{
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
Expand Down Expand Up @@ -1137,7 +1137,7 @@ mod tests {
impl<K, V> RangeInclusiveMapExt<K, V> for RangeInclusiveMap<K, V, K>
where
K: Ord + Clone + StepLite,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn to_vec(&self) -> Vec<(RangeInclusive<K>, V)> {
self.iter().map(|(kr, v)| (kr.clone(), v.clone())).collect()
Expand Down
18 changes: 9 additions & 9 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where
impl<K, V> quickcheck::Arbitrary for RangeMap<K, V>
where
K: quickcheck::Arbitrary + Ord,
V: quickcheck::Arbitrary + Eq,
V: quickcheck::Arbitrary + PartialEq,
{
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
// REVISIT: allocation could be avoided if Gen::gen_size were public (https://github.com/BurntSushi/quickcheck/issues/326#issue-2653601170)
Expand Down Expand Up @@ -243,7 +243,7 @@ where
impl<K, V> RangeMap<K, V>
where
K: Ord + Clone,
V: Eq + Clone,
V: PartialEq + Clone,
{
/// Insert a pair of key range and value into the map.
///
Expand Down Expand Up @@ -610,7 +610,7 @@ impl<K: Debug, V: Debug> Debug for RangeMap<K, V> {
impl<K, V> FromIterator<(Range<K>, V)> for RangeMap<K, V>
where
K: Ord + Clone,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn from_iter<T: IntoIterator<Item = (Range<K>, V)>>(iter: T) -> Self {
let mut range_map = RangeMap::new();
Expand All @@ -622,7 +622,7 @@ where
impl<K, V> Extend<(Range<K>, V)> for RangeMap<K, V>
where
K: Ord + Clone,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn extend<T: IntoIterator<Item = (Range<K>, V)>>(&mut self, iter: T) {
iter.into_iter().for_each(move |(k, v)| {
Expand Down Expand Up @@ -654,7 +654,7 @@ where
impl<'de, K, V> Deserialize<'de> for RangeMap<K, V>
where
K: Ord + Clone + Deserialize<'de>,
V: Eq + Clone + Deserialize<'de>,
V: PartialEq + Clone + Deserialize<'de>,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -682,7 +682,7 @@ impl<K, V> RangeMapVisitor<K, V> {
impl<'de, K, V> Visitor<'de> for RangeMapVisitor<K, V>
where
K: Ord + Clone + Deserialize<'de>,
V: Eq + Clone + Deserialize<'de>,
V: PartialEq + Clone + Deserialize<'de>,
{
type Value = RangeMap<K, V>;

Expand Down Expand Up @@ -819,7 +819,7 @@ where
}
}

impl<K: Ord + Clone, V: Eq + Clone, const N: usize> From<[(Range<K>, V); N]> for RangeMap<K, V> {
impl<K: Ord + Clone, V: PartialEq + Clone, const N: usize> From<[(Range<K>, V); N]> for RangeMap<K, V> {
fn from(value: [(Range<K>, V); N]) -> Self {
let mut map = Self::new();
for (range, value) in IntoIterator::into_iter(value) {
Expand Down Expand Up @@ -859,7 +859,7 @@ mod tests {
impl<K, V> Arbitrary for RangeMap<K, V>
where
K: Ord + Clone + Debug + Arbitrary + 'static,
V: Clone + Eq + Arbitrary + 'static,
V: Clone + PartialEq + Arbitrary + 'static,
{
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
Expand Down Expand Up @@ -1018,7 +1018,7 @@ mod tests {
impl<K, V> RangeMapExt<K, V> for RangeMap<K, V>
where
K: Ord + Clone,
V: Eq + Clone,
V: PartialEq + Clone,
{
fn to_vec(&self) -> Vec<(Range<K>, V)> {
self.iter().map(|(kr, v)| (kr.clone(), v.clone())).collect()
Expand Down