bring back sugg::range
This commit is contained in:
parent
05f637cf88
commit
d5534ca9db
@ -175,6 +175,16 @@ impl<'a> Sugg<'a> {
|
||||
make_unop("&mut *", self)
|
||||
}
|
||||
|
||||
/// Convenience method to create the `<lhs>..<rhs>` or `<lhs>...<rhs>`
|
||||
/// suggestion.
|
||||
#[allow(dead_code)]
|
||||
pub fn range(self, end: &Self, limit: ast::RangeLimits) -> Sugg<'static> {
|
||||
match limit {
|
||||
ast::RangeLimits::HalfOpen => make_assoc(AssocOp::DotDot, &self, end),
|
||||
ast::RangeLimits::Closed => make_assoc(AssocOp::DotDotEq, &self, end),
|
||||
}
|
||||
}
|
||||
|
||||
/// Add parenthesis to any expression that might need them. Suitable to the
|
||||
/// `self` argument of
|
||||
/// a method call (eg. to build `bar.foo()` or `(1 + 2).foo()`).
|
||||
|
Loading…
Reference in New Issue
Block a user