line_column/span/
wrapper.rs1use super::*;
2
3#[derive(Clone, Default)]
5#[repr(transparent)]
6pub struct EmptySpan {
7 span: Span,
8}
9impl fmt::Debug for EmptySpan {
10 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11 debug_assert!(self.is_empty());
12 write!(f, "EmptySpan({:?})", self.range().start())
13 }
14}
15impl ops::Deref for EmptySpan {
16 type Target = Span;
17
18 fn deref(&self) -> &Self::Target {
19 &self.span
20 }
21}
22impl From<EmptySpan> for Span {
23 fn from(span: EmptySpan) -> Self {
24 span.span
25 }
26}
27impl From<&EmptySpan> for Span {
28 fn from(span: &EmptySpan) -> Self {
29 span.span.clone()
30 }
31}
32
33