def line_end

bend-lint-rules@0.2.0.0 · layout/format.bend:2351

import bend-lint-rules@0.2.0.0/layout/format.bend as Format
import Base

2351# Where the line that `s` starts, at `i`, ends: before its newline, or at the end of the text.
2352def line_end(s: String, i: U32) -> U32:
2353  match s:
2354    case SNil{}:
2355      i
2356    case SCon{'\n', rest}:
2357      i
2358    case SCon{c, rest}:
2359      line_end(rest, (i + 1: U32))

Uses (7)

Used by (1)