You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand why you're making this suggestion, but I've never been a huge fan of the impl Into<Option<...>> trick. I generally don't like its implicitness and find that it makes the call sites more difficult to read.
I'm not totally opposed to it though. I'll noodle on it. If you want to put up a PR, that would be great!
Consider also, you could have a Color::None or Color::Default or whatever variant. That way, you wouldn't have to deal with Options anymore. You get the ergonomic benefit of doing ColorSpec::new().set_fg(Color::Red), while maintaining a simple (actually, simpler) function signature
Hey,
While using this library I felt like it could benefit ergonomically from changing the signature of two functions:
Changing them to:
This would allow for developers, using this library, to configure a ColorSpec struct like this:
Rather than:
This would also be backwards compatible, meaning that any case of
.set_fg(Some(Color::Red))
would still be valid.I would be happy to make a PR if you decide that this would be beneficial for the library.
Thank you!
The text was updated successfully, but these errors were encountered: