RS.CLIPPY.UNNECESSARY_SEMICOLON

Unnecessary semicolon after expression returning `()`

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

What it does

Checks for the presence of a semicolon at the end of a match or if statement evaluating to ().

Why is this bad?

The semicolon is not needed, and may be removed to avoid confusion and visual clutter.

Example

if a > 10 {
    println!("a is greater than 10");
};

Use instead:

if a > 10 {
    println!("a is greater than 10");
}