mirror of
https://github.com/rwf2/Rocket.git
synced 2025-02-18 06:32:03 +00:00
Remove unneeded 'SpanExt::expand' method.
This commit is contained in:
parent
1ccaccc2d8
commit
e8ada89197
@ -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)])
|
||||
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user