Skip to content
Snippets Groups Projects
Commit 248bd029 authored by Eduardo Trujillo's avatar Eduardo Trujillo
Browse files

feat: Add Clone derivations

parent 15ff1f2f
Loading
Pipeline #2117 passed
......@@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use thiserror::Error;
/// Error type for [`RangeDict`]
#[derive(Error, Debug, PartialEq)]
#[derive(Clone, Error, Debug, PartialEq)]
pub enum RangeDictError {
/// Used when an invalid range is provided (e.g. End is before start).
#[error("Invalid range provided")]
......@@ -20,7 +20,7 @@ pub enum RangeDictError {
/// Powereded by a BTreeMap under the hood.
///
/// Note: Ranges are inclusive.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct RangeDict<RK: Ord + Copy, V> {
ranges: BTreeMap<RK, (RK, V)>, // Key: start of range, Value: (end, associated value)
}
......
......@@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use thiserror::Error;
/// Error type for [`RangeSet`]
#[derive(Error, Debug, PartialEq)]
#[derive(Clone, Error, Debug, PartialEq)]
pub enum RangeSetError {
/// Used when an invalid range is provided (e.g. End is before start).
#[error("Invalid range provided")]
......@@ -14,7 +14,7 @@ pub enum RangeSetError {
}
/// A set of non-overlapping ranges.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct RangeSet<RK: Ord + Copy> {
ranges: BTreeMap<RK, RK>, // Maps start -> end
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment