# no-needless-continue

Disallow continue where control already proceeds to the same iteration

A `continue` at the end of its target loop path repeats the control transfer already performed by ordinary completion.
Instead, you SHOULD remove the redundant statement and let the iteration finish normally.

- Category: style
- Level: warning
- Fix: automatic
- Scope: module

## Reported

```ds title="main.ds"
function visit(values: int32[]): void {
    for (const value of values) {
        value;
        continue;
    }
}
```

## Accepted

```ds title="main.ds"
function visit(values: int32[]): void {
    for (const value of values) {
        value;
    }
}
```

## Prior art

- [Clippy · needless_continue](https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue)

[language/linter/src/rules/style/no_needless_continue.rs:6](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/no_needless_continue.rs#L6)
