Rellum Rellum

S0056: cannot infer ok type of err

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

Explanation

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

Common causes

Canonical fixes

Before:

value = err("failed")

After:

value: Result[Int, String] = err("failed")

Before:

parse() = err("failed")

After:

parse() : Result[Int, String] = err("failed")

Code example

value = err("failed")