Skip to content

Commit b7335cb

Browse files
committed
enable serde feat for spans and locations
1 parent a04888a commit b7335cb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tokenizer.rs

+2
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ impl fmt::Display for Whitespace {
417417

418418
/// Location in input string
419419
#[derive(Eq, PartialEq, Hash, Clone, Copy, Ord, PartialOrd)]
420+
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
420421
pub struct Location {
421422
/// Line number, starting from 1
422423
pub line: u64,
@@ -456,6 +457,7 @@ impl From<(u64, u64)> for Location {
456457
}
457458

458459
#[derive(Eq, PartialEq, Hash, Clone, PartialOrd, Ord, Copy)]
460+
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
459461
pub struct Span {
460462
pub start: Location,
461463
pub end: Location,

0 commit comments

Comments
 (0)