From e93767b395ca18ac895e0d52520c2586b7aae0e6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 3 Dec 2021 18:00:41 +0100 Subject: [PATCH] Apply new lint on clippy source code --- clippy_utils/src/hir_utils.rs | 2 ++ clippy_utils/src/sugg.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs index 7438b6eabf9..c1eaa5c5185 100644 --- a/clippy_utils/src/hir_utils.rs +++ b/clippy_utils/src/hir_utils.rs @@ -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)), diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs index 872942685f0..586934df460 100644 --- a/clippy_utils/src/sugg.rs +++ b/clippy_utils/src/sugg.rs @@ -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,