-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow colorizing any type implementing a formatter trait #139
Comments
Oh by the way, what are your thoughts on having a v3 @mackwic @kurtlawrence? I'd definitely like to get your guys' opinions before doing anything huge. I was also thinking of moving the current codebase to a |
I think there are enough new features to justify a Maybe we mark PRs 'breaking' and then try to merge in all non-breaking PRs and do a final |
Yeah I like that idea @kurtlawrence, I think that'd be good to keep things smooth. I can look at some PRs tomorrow and try to slim them down, and then all the |
Rust has several formatter traits, all of could be printed out (and likewise colored).
Currently this crate only provides a way to print via the
Display
trait - any formatting traits would have to be done via a method such asformat!("{item:?}").blue()
, which can get a bit clunky.The proposed method to fix this is to allow any type to be formatted, as long as it implements the corresponding formatting type. I.e. if a type implements
Debug
, doing something likeprintln!("{:?}", item.blue())
should work just fine.owo-colors
uses this method, and it's of my view that it's quite a good method of doing things. I think this crate should consider doing a similar approach for a v3, along with some other changes that people are requesting in this repository.The text was updated successfully, but these errors were encountered: