Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
collective
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eduardo Trujillo
collective
Commits
248bd029
Commit
248bd029
authored
3 weeks ago
by
Eduardo Trujillo
Browse files
Options
Downloads
Patches
Plain Diff
feat: Add Clone derivations
parent
15ff1f2f
Loading
Loading
Loading
Pipeline
#2117
passed
3 weeks ago
Stage: format
Stage: build
Stage: lint
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rangedict.rs
+2
-2
2 additions, 2 deletions
src/rangedict.rs
src/rangeset.rs
+2
-2
2 additions, 2 deletions
src/rangeset.rs
with
4 additions
and
4 deletions
src/rangedict.rs
+
2
−
2
View file @
248bd029
...
...
@@ -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)
}
...
...
This diff is collapsed.
Click to expand it.
src/rangeset.rs
+
2
−
2
View file @
248bd029
...
...
@@ -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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment