diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-08-27 00:34:53 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2025-08-27 00:35:13 +0200 |
| commit | 27d005a1710e7ccd81020baca635475856485f20 (patch) | |
| tree | c0ecd775e3a40e4d48df4db1881980b34d9b5434 | |
| parent | 9bfa95b6b310952fabe94b21d37aa0a61779c47d (diff) | |
| download | rust-27d005a1710e7ccd81020baca635475856485f20.tar.gz rust-27d005a1710e7ccd81020baca635475856485f20.zip | |
Document `is_unit_expr()`
| -rw-r--r-- | clippy_utils/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index e038a33dca3..df47b9f7e33 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, |
