while-let-loop Prefer while-let over an unconditional pattern loop An unconditional loop that continues only while one pattern matches hides its condition in the body. Instead, you SHOULD place the successful pattern and value in a while-let condition. The matched expression remains evaluated once at the start of each iteration. - Category: style - Level: warning - Fix: suggestion - Scope: module Reported declare function next(): Result; function consume(): void { loop { match (next()) { Ok { value } => { value; } Err { error: _ } => break } } } Accepted declare function next(): Result; function consume(): void { while (let Ok { value } = next()) { value; } } Prior art - Clippy ยท whileletloop language/linter/src/rules/style/whileletloop.rs:8