Rellum Rellum

S0030: tuple field is out of bounds

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

Explanation

Tuple field indexes are zero-based and must refer to an existing tuple element. Accessing .N past the tuple's last element would read a value that is not part of the tuple.

Common causes

Canonical fixes

Before:

value = pair.2

After:

value = pair.1

Before:

pair = (left, right)
value = pair.2

After:

triple = (left, middle, right)
value = triple.2

Code example

value = pair.2