def phrase.chop.at

emerging-ezhttp@0.22.0.0 · src/http.bend:1759

import emerging-ezhttp@0.22.0.0/src/http.bend as Http
import Base

1759# a reason phrase with the CR its line ended with removed; a reason-phrase
1760# itself holds no CR (RFC 9112 §4)
1761def phrase.chop.at(
1762  cr: Bool,
1763  ch: Char,
1764  tl: String,
1765  rest: Unit -> String
1766) -> String:
1767  match cr tl:
1768    case True{} SNil{}:
1769      SNil{}
1770    case True{} SCon{x, xt}:
1771      SCon{ch, rest(Unit{})}
1772    case False{} _:
1773      SCon{ch, rest(Unit{})}

Uses (4)

Used by (1)