Skip to content

Commit

Permalink
Apply new lint on clippy source code
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 4, 2021
1 parent f1bd88b commit ca04751
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {
}

/// Consider expressions containing potential side effects as not equal.
#[must_use]
pub fn deny_side_effects(self) -> Self {
Self {
allow_side_effects: false,
..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)),
Expand Down
1 change: 1 addition & 0 deletions clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ impl<'a> Sugg<'a> {
/// 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,
Expand Down

0 comments on commit ca04751

Please sign in to comment.