diff --git a/src/style.rs b/src/style.rs index 3058767..f725410 100644 --- a/src/style.rs +++ b/src/style.rs @@ -60,8 +60,20 @@ impl Style { /// let style = Style::new(); /// println!("{}", style.paint("hi")); /// ``` - pub fn new() -> Style { - Style::default() + pub const fn new() -> Style { + Style { + foreground: None, + background: None, + is_bold: false, + is_dimmed: false, + is_italic: false, + is_underline: false, + is_blink: false, + is_reverse: false, + is_hidden: false, + is_strikethrough: false, + prefix_with_reset: false, + } } /// Returns a [`Style`] with the `Style.prefix_with_reset` property set. @@ -278,19 +290,7 @@ impl Default for Style { /// assert_eq!("txt", Style::default().paint("txt").to_string()); /// ``` fn default() -> Style { - Style { - foreground: None, - background: None, - is_bold: false, - is_dimmed: false, - is_italic: false, - is_underline: false, - is_blink: false, - is_reverse: false, - is_hidden: false, - is_strikethrough: false, - prefix_with_reset: false, - } + Style::new() } }