S0053: ok pattern requires Result
Generated from rellum-diagnostics/src/db.rs.
Explanation
The ok(...) pattern extracts the success payload from a Result value. It cannot match Option, Bool, enum, record, or scalar values because those types do not have Result's ok/err shape.
Common causes
- using ok(x) while matching an Option
- matching a plain value as if it were a Result
- forgetting that a request handler has already converted the raw Result
Canonical fixes
- match a Result value with ok and err arms
Before:
match value
ok(x) => x
After:
match result
ok(x) => x
err(_) => fallback
- use some(x) and none when matching Option
Before:
match value
ok(x) => x
After:
match value
some(x) => x
none => fallback
Code example
match value
ok(x) => x