From e35cab240864a42613a1ec444bce4aef3aa71629 Mon Sep 17 00:00:00 2001 From: Koxiaet Date: Mon, 4 Jan 2021 08:16:08 +0000 Subject: [PATCH] Remove extra Clone bounds in the style module (#534) --- src/style.rs | 5 +---- src/style/styled_content.rs | 4 ++-- src/style/traits.rs | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/style.rs b/src/style.rs index 25899a0..889c7e4 100644 --- a/src/style.rs +++ b/src/style.rs @@ -153,10 +153,7 @@ mod types; /// /// println!("{}", styled_content); /// ``` -pub fn style<'a, D: 'a>(val: D) -> StyledContent -where - D: Display + Clone, -{ +pub fn style(val: D) -> StyledContent { ContentStyle::new().apply(val) } diff --git a/src/style/styled_content.rs b/src/style/styled_content.rs index 8c58bf6..bb95989 100644 --- a/src/style/styled_content.rs +++ b/src/style/styled_content.rs @@ -132,11 +132,11 @@ impl Display for StyledContent { } } -impl Colorize for StyledContent { +impl Colorize for StyledContent { impl_colorize_callback!(def_color_generic!(())); } -impl Styler for StyledContent { +impl Styler for StyledContent { impl_styler_callback!(def_attr_generic!(())); } diff --git a/src/style/traits.rs b/src/style/traits.rs index b8d7653..d83e02a 100644 --- a/src/style/traits.rs +++ b/src/style/traits.rs @@ -17,7 +17,7 @@ use super::StyledContent; /// let styled_text = "Red foreground color on blue background.".red().on_blue(); /// println!("{}", styled_text); /// ``` -pub trait Colorize { +pub trait Colorize { fn black(self) -> StyledContent; fn dark_grey(self) -> StyledContent; fn red(self) -> StyledContent; @@ -66,7 +66,7 @@ pub trait Colorize { /// println!("{}", "Underlined text".underlined()); /// println!("{}", "Negative text".negative()); /// ``` -pub trait Styler { +pub trait Styler { fn reset(self) -> StyledContent; fn bold(self) -> StyledContent; fn underlined(self) -> StyledContent;