rust-ansi-term icon indicating copy to clipboard operation
rust-ansi-term copied to clipboard

recommendation for printing single chars

Open softprops opened this issue 8 years ago • 1 comments

Thanks for putting together such a nice crate. I wanted to ask for suggestion path for an usage issue I ran into. I ran into an issue where I wanted to paint a single char but was forced to allocate a new string to machine requirements with the Color#paint method. I was wondering if you had suggestions for an alternate approach.

softprops avatar Aug 28 '17 05:08 softprops

Dunno if you ever solved your issue, but https://doc.rust-lang.org/std/primitive.char.html#method.encode_utf8 does what you want using a buffer on the stack.

Lokathor avatar Mar 13 '19 07:03 Lokathor