Rellum Rellum

S0022: some pattern requires Option

Generated from rellum-diagnostics/src/db.rs.

Explanation

The some(x) pattern extracts the payload from an Option value. It cannot match Result, Bool, enum, record, or scalar values because those types do not have Option's some/none shape.

Common causes

Canonical fixes

Before:

match value
    some(x) => x

After:

match maybe
    some(x) => x
    none => fallback

Before:

match result
    some(x) => x

After:

match result
    ok(x) => x
    err(_) => fallback

Code example

match value
    some(x) => x