We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05f637c commit d5534caCopy full SHA for d5534ca
clippy_lints/src/utils/sugg.rs
@@ -175,6 +175,16 @@ impl<'a> Sugg<'a> {
175
make_unop("&mut *", self)
176
}
177
178
+ /// Convenience method to create the `<lhs>..<rhs>` or `<lhs>...<rhs>`
179
+ /// suggestion.
180
+ #[allow(dead_code)]
181
+ pub fn range(self, end: &Self, limit: ast::RangeLimits) -> Sugg<'static> {
182
+ match limit {
183
+ ast::RangeLimits::HalfOpen => make_assoc(AssocOp::DotDot, &self, end),
184
+ ast::RangeLimits::Closed => make_assoc(AssocOp::DotDotEq, &self, end),
185
+ }
186
187
+
188
/// Add parenthesis to any expression that might need them. Suitable to the
189
/// `self` argument of
190
/// a method call (eg. to build `bar.foo()` or `(1 + 2).foo()`).
0 commit comments