summaryrefslogtreecommitdiff
path: root/src/syntax/span.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-09-30 12:49:30 +0200
committerLaurenz <laurmaedje@gmail.com>2020-09-30 12:49:30 +0200
commit3e791e3337b912ebc1f1771c4a1c0e4ed5723198 (patch)
treeb2c54ba4f24111423c60c4a32e1616fedecce58d /src/syntax/span.rs
parentbc1b4216a802d09e8d00dd277a0e204d49bcaa7f (diff)
Move decoration into mod.rs 🔙
Diffstat (limited to 'src/syntax/span.rs')
-rw-r--r--src/syntax/span.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs
index 9357c345..6f5420d4 100644
--- a/src/syntax/span.rs
+++ b/src/syntax/span.rs
@@ -6,9 +6,6 @@ use std::ops::{Add, Sub};
#[cfg(test)]
use std::cell::Cell;
-#[cfg(feature = "serialize")]
-use serde::Serialize;
-
#[cfg(test)]
thread_local! {
static CMP_SPANS: Cell<bool> = Cell::new(true);
@@ -34,7 +31,7 @@ impl<T> Offset for SpanVec<T> {
/// A value with the span it corresponds to in the source code.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
-#[cfg_attr(feature = "serialize", derive(Serialize))]
+#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
pub struct Spanned<T> {
pub span: Span,
pub v: T,
@@ -92,7 +89,7 @@ impl<T: Debug> Debug for Spanned<T> {
/// Locates a slice of source code.
#[derive(Copy, Clone, Ord, PartialOrd, Hash)]
-#[cfg_attr(feature = "serialize", derive(Serialize))]
+#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
pub struct Span {
/// The inclusive start position.
pub start: Pos,
@@ -164,7 +161,7 @@ impl Debug for Span {
/// Zero-indexed line-column position in source code.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
-#[cfg_attr(feature = "serialize", derive(Serialize))]
+#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
pub struct Pos {
/// The zero-indexed line.
pub line: usize,