Dogfood fixes to use bool::then_some
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user