Skip to content
/ ziglint Public

new rule: no useless defer #34

@nektro

Description

@nektro
if (foo) {
    defer bar();
}

bar is defer'd in a block where it's the only statement. this is a no-op.

additionally consider warning that if in an if statement defer if ... should be used instead of if (...) { defer ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions