def first_newline
import bend-lint-rules@0.2.0.0/layout/format.bend as Formatimport 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)