rust: Generalize the `trim_end_newlines` utility of byte strings...
rust: Generalize the `trim_end_newlines` utility of byte strings
… into `trim_end_matches` that takes a callack.
Also add `trim_start_matches`.
Differential Revision:
https://phab.mercurial-scm.org/D11388