unnecessary-unwrap Disallow unwrap after checked control flow proves the Result variant Unwrapping a Result after control flow has already narrowed it repeats a variant check that is known to succeed. Instead, you SHOULD read the narrowed variant payload directly. - Category: style - Level: warning - Fix: automatic - Scope: module Reported function value(result: Result): int32 { if (result.kind === "Ok") { return result.unwrap(); } return 0; } Accepted function value(result: Result): int32 { if (result.kind === "Ok") { return result.value; } return 0; } Prior art - Clippy ยท unnecessaryunwrap language/linter/src/rules/style/unnecessaryunwrap.rs:8