S0092: ? operand is not a Result
Generated from rellum-diagnostics/src/db.rs.
Explanation
The ? operator can only unwrap Result values. It extracts ok(v) for continued execution and returns err(e) early; non-Result values have no ok/err shape to inspect.
Common causes
- placing ? after an Int, String, Option, or other non-Result value
- calling a helper that returns a plain value but treating it as fallible
- using ? on a request's stored value after handlers have converted it
Canonical fixes
- remove ? when the expression is not fallible
Before:
value = count?
After:
value = count
- return Result from the helper if it can fail
- use match for Option values
Before:
value = maybe?
After:
value = match maybe
some(v) => v
none => fallback
Code example
value = count?