Comment by dang
Thanks! Your second option is almost identical to Mlller's (https://news.ycombinator.com/item?id=44988801) but the extra curly braces make it not fit. Seems like they're droppable for characters below U+FFFF, so I've squeezed it in above.
That works! (The braces are droppable for 16-bit codepoints in JS, but required in Rust.)