Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/lib.rs')
| -rw-r--r-- | crates/span/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/span/src/lib.rs b/crates/span/src/lib.rs index 0fe3275863..b2624762df 100644 --- a/crates/span/src/lib.rs +++ b/crates/span/src/lib.rs @@ -56,6 +56,12 @@ pub struct SpanData<Ctx> { pub ctx: Ctx, } +impl<Ctx: Copy> SpanData<Ctx> { + pub fn eq_ignoring_ctx(self, other: Self) -> bool { + self.anchor == other.anchor && self.range == other.range + } +} + impl Span { #[deprecated = "dummy spans will panic if surfaced incorrectly, as such they should be replaced appropriately"] pub const DUMMY: Self = SpanData { |