-
-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Description
console::strip_ansi_codes copies the entire string if it contains any ANSI. In cases where the stripped string needs to be written to something that implements Write, copying the string is completely unnecessary. If there was a struct like WithoutAnsi which implemented Display, it could be used to efficiently write to a serial port (my use case) without copying data.
I can make a PR for this, just let me know how the API should be. Imo it should be something like
pub struct WithoutAnsi;
impl<'a> WithoutAnsi<'a> {
pub fn new(&'a str) -> Self;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels