def first_newline

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

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

2395def first_newline(s: String) -> String:
2396  match s:
2397    case SNil{}:
2398      "\n"
2399    case SCon{'\r', SCon{'\n', rest}}:
2400      "\r\n"
2401    case SCon{'\n', rest}:
2402      "\n"
2403    case SCon{c, rest}:
2404      first_newline(rest)

Uses (6)

Used by (1)