Apply new lint on clippy source code

This commit is contained in:
Guillaume Gomez 2021-12-03 18:00:41 +01:00
parent 2b35edbb84
commit e93767b395
2 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,7 @@ pub fn new(cx: &'a LateContext<'tcx>) -> Self {
}
/// Consider expressions containing potential side effects as not equal.
#[must_use]
pub fn deny_side_effects(self) -> Self {
Self {
allow_side_effects: false,
@ -48,6 +49,7 @@ pub fn deny_side_effects(self) -> Self {
}
}
#[must_use]
pub fn expr_fallback(self, expr_fallback: impl FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a) -> Self {
Self {
expr_fallback: Some(Box::new(expr_fallback)),

View File

@ -294,6 +294,7 @@ pub fn range(self, end: &Self, limit: ast::RangeLimits) -> Sugg<'static> {
/// Adds parentheses to any expression that might need them. Suitable to the
/// `self` argument of a method call
/// (e.g., to build `bar.foo()` or `(1 + 2).foo()`).
#[must_use]
pub fn maybe_par(self) -> Self {
match self {
Sugg::NonParen(..) => self,