def text.rstrip.put
import ezsys@0.1.0.0/src/str.bend as Strimport Base
55# a character before the stripped rest: when nothing is left after it, it
56# goes too if it is whitespace
57def text.rstrip.put(+hd: Char, rule: String) -> String:
58 match rule:
59 case SNil{}:
60 text.rstrip.lone(text.space(hd), hd)
61 case SCon{a, b}:
62 SCon{hd, SCon{a, b}}