diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2022-07-06 00:52:53 -0700 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2022-07-06 02:03:56 -0700 |
| commit | b7230d4f44e974c6639980a2e44e8d7523b6c90c (patch) | |
| tree | bf10a79164fc5ae3b82b4f54b61ceabd09c75fa2 /clippy_utils | |
| parent | ebff7206bcc4c740be9016dc7d2e10cf421463f9 (diff) | |
| download | rust-b7230d4f44e974c6639980a2e44e8d7523b6c90c.tar.gz rust-b7230d4f44e974c6639980a2e44e8d7523b6c90c.zip | |
Dogfood fixes to use `bool::then_some`
Diffstat (limited to 'clippy_utils')
| -rw-r--r-- | clippy_utils/src/lib.rs | 2 | ||||
| -rw-r--r-- | clippy_utils/src/source.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 9fa28e137f9..0e739303683 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -1016,7 +1016,7 @@ pub fn can_move_expr_to_closure<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<' captures: HirIdMap::default(), }; v.visit_expr(expr); - v.allow_closure.then(|| v.captures) + v.allow_closure.then_some(v.captures) } /// Returns the method names and argument list of nested method call expressions that make up diff --git a/clippy_utils/src/source.rs b/clippy_utils/src/source.rs index f88a92fb11c..1197fe914de 100644 --- a/clippy_utils/src/source.rs +++ b/clippy_utils/src/source.rs @@ -353,7 +353,7 @@ pub fn snippet_with_context<'a>( /// span containing `m!(0)`. pub fn walk_span_to_context(span: Span, outer: SyntaxContext) -> Option<Span> { let outer_span = hygiene::walk_chain(span, outer); - (outer_span.ctxt() == outer).then(|| outer_span) + (outer_span.ctxt() == outer).then_some(outer_span) } /// Removes block comments from the given `Vec` of lines. |
