Why can a Rust struct be defined without a semicolon?

Viewed 858

I'm learning Rust and the chapter for structs gives an example of a struct without a ; at the end. It compiles but I have no idea why this is allowed.

fn main() {
    struct User {
        username: String,
        email: String,
        sign_in_count: u64,
        active: bool,
    }
}

... same question goes for functions, actually.

1 Answers
Related