Remove unneeded 'SpanExt::expand' method.

This commit is contained in:
Sergio Benitez 2017-09-25 21:19:50 -07:00
parent 1ccaccc2d8
commit e8ada89197
2 changed files with 1 additions and 9 deletions

View File

@ -43,7 +43,7 @@ impl Param {
};
// Calculate the parameter's ident and span.
let param_span = span.expand(start, end + 1);
let param_span = span.trim_left(start).shorten_to(end + 1);
let full_param = &string[(start + 1)..end];
let (is_many, param) = if full_param.ends_with("..") {
(true, &full_param[..(full_param.len() - 2)])

View File

@ -18,9 +18,6 @@ pub trait SpanExt {
// Wrap `T` into a `Spanned<T>` with `self` as the span.
fn wrap<T>(self, node: T) -> Spanned<T>;
/// Expand the span on the left by `left` and right by `right`.
fn expand(self, left: usize, right: usize) -> Span;
}
impl SpanExt for Span {
@ -48,9 +45,4 @@ impl SpanExt for Span {
fn wrap<T>(self, node: T) -> Spanned<T> {
Spanned { node: node, span: self }
}
fn expand(self, left: usize, right: usize) -> Span {
self.with_lo(self.lo() + BytePos(left as u32))
.with_hi(self.lo() + BytePos(right as u32))
}
}