lengthOr method

int lengthOr(
  1. int length
)

Returns the length of the list if it is a success, or length

Implementation

int lengthOr(int length) =>
    switch (this) { Success(:final value) => value.length, _ => length };