nu-ansi-term
nu-ansi-term copied to clipboard
feat: allow construct Style constantly
For what purpose? We recently closed these similar PRs. https://github.com/nushell/nu-ansi-term/pull/60 https://github.com/nushell/nu-ansi-term/pull/61
My highlighter has a const color and I'd configure the color as a const.
Of course it's possible to initialize once at runtime and reuse the field, but I saw other existing const fns like:
- pub const fn reset_before_style(&self) -> Style
- pub const fn bold(&self) -> Style
- pub const fn dimmed(&self) -> Style
- pub const fn italic(&self) -> Style
- pub const fn underline(&self) -> Style
- pub const fn blink(&self) -> Style
- pub const fn reverse(&self) -> Style
- pub const fn hidden(&self) -> Style
- pub const fn strikethrough(&self) -> Style
- pub const fn fg(&self, foreground: Color) -> Style
- pub const fn on(&self, background: Color) -> Style
So why not for new as it's in the same situation.