Rellum Rellum

S0020: min/max require an ordered scalar type

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

Explanation

The built-in min and max functions are defined only for Int, Float, and Char in V1. They rely on a total ordering that arrays, records, enums, strings, and function values do not currently provide.

Common causes

Canonical fixes

Before:

best = max(left_name, right_name)

After:

best_len = max(len(left_name), len(right_name))

Code example

best = max(left_name, right_name)