Skip to content

Commit

Permalink
Remove unused traits
Browse files Browse the repository at this point in the history
  • Loading branch information
BinderDavid committed Jan 4, 2025
1 parent 7a1d099 commit 04d38fb
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions lang/miette_util/src/codespan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::fmt;
use std::ops::{Add, AddAssign, Neg, Sub, SubAssign};
use std::ops::{Add, Sub};

/// A byte position in a source file.
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
Expand Down Expand Up @@ -252,31 +252,3 @@ impl Location {
Location { line: line.into(), column: column.into() }
}

Check warning on line 253 in lang/miette_util/src/codespan.rs

View check run for this annotation

Codecov / codecov/patch

lang/miette_util/src/codespan.rs#L251-L253

Added lines #L251 - L253 were not covered by tests
}

/// A relative offset between two indices
///
/// These can be thought of as 1-dimensional vectors
pub trait Offset: Copy + Ord
where
Self: Neg<Output = Self>,
Self: Add<Self, Output = Self>,
Self: AddAssign<Self>,
Self: Sub<Self, Output = Self>,
Self: SubAssign<Self>,
{
const ZERO: Self;
}

/// Index types
///
/// These can be thought of as 1-dimensional points
pub trait Index: Copy + Ord
where
Self: Add<<Self as Index>::Offset, Output = Self>,
Self: AddAssign<<Self as Index>::Offset>,
Self: Sub<<Self as Index>::Offset, Output = Self>,
Self: SubAssign<<Self as Index>::Offset>,
Self: Sub<Self, Output = <Self as Index>::Offset>,
{
type Offset: Offset;
}

0 comments on commit 04d38fb

Please sign in to comment.