Skip to content

Commit 9121dcc

Browse files
authored
Document is_unit_expr() (#15571)
Noticed when reviewing #15562. Part of #15569. changelog: none
2 parents cc0df52 + 27d005a commit 9121dcc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_utils/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ pub fn is_lang_item_or_ctor(cx: &LateContext<'_>, did: DefId, item: LangItem) ->
309309
cx.tcx.lang_items().get(item) == Some(did)
310310
}
311311

312+
/// Checks if `expr` is an empty block or an empty tuple.
312313
pub fn is_unit_expr(expr: &Expr<'_>) -> bool {
313314
matches!(
314315
expr.kind,

0 commit comments

Comments
 (0)