RS.CLIPPY.LET_UNIT_VALUE

Creating a `let` binding to a value of unit type, which usually can't be used afterwards

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: let_unit_value. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for binding a unit value.

Why is this bad?

A unit value cannot usefully be used anywhere. So binding one is kind of pointless.

Example

let x = {
    1;
};