From 27d005a1710e7ccd81020baca635475856485f20 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 27 Aug 2025 00:34:53 +0200 Subject: [PATCH] Document `is_unit_expr()` --- clippy_utils/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index e038a33dca39..df47b9f7e33b 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -309,6 +309,7 @@ pub fn is_lang_item_or_ctor(cx: &LateContext<'_>, did: DefId, item: LangItem) -> cx.tcx.lang_items().get(item) == Some(did) } +/// Checks if `expr` is an empty block or an empty tuple. pub fn is_unit_expr(expr: &Expr<'_>) -> bool { matches!( expr.kind,