diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-01 17:54:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-01 17:54:31 +0100 |
| commit | 8cad78481cd52680317032c3bb84cacda5666489 (patch) | |
| tree | 7cc0d17b2ec6d231c33205fa4765de1d63ee32ea /src/syntax/span.rs | |
| parent | 2b6ccd82489afbcd679fb3199de2618fa8811325 (diff) | |
A few small improvements ♻
Diffstat (limited to 'src/syntax/span.rs')
| -rw-r--r-- | src/syntax/span.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs index 820de3b3..20008354 100644 --- a/src/syntax/span.rs +++ b/src/syntax/span.rs @@ -12,14 +12,14 @@ thread_local! { } /// Annotate a value with a span. -pub trait SpanWith: Sized { +pub trait WithSpan: Sized { /// Wraps `self` in a `Spanned` with the given span. - fn span_with(self, span: impl Into<Span>) -> Spanned<Self> { + fn with_span(self, span: impl Into<Span>) -> Spanned<Self> { Spanned::new(self, span) } } -impl<T> SpanWith for T {} +impl<T> WithSpan for T {} /// Span offsetting. pub trait Offset { @@ -81,7 +81,7 @@ impl<T> Spanned<Option<T>> { /// Swap the spanned and the option. pub fn transpose(self) -> Option<Spanned<T>> { let Spanned { v, span } = self; - v.map(|v| v.span_with(span)) + v.map(|v| v.with_span(span)) } } |
