Rellum Rellum

S0055: cannot infer error type of ok

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

Explanation

The ok(...) constructor supplies the success payload of a Result, but it does not name the error type. The surrounding annotation or expected type must establish Result[T, E] so the compiler can choose E.

Common causes

Canonical fixes

Before:

value = ok(1)

After:

value: Result[Int, String] = ok(1)

Before:

parse() = ok(1)

After:

parse() : Result[Int, String] = ok(1)

Code example

value = ok(1)