Remove extra Clone bounds in the style module (#534)

This commit is contained in:
Koxiaet 2021-01-04 08:16:08 +00:00 committed by GitHub
parent 5319f3c673
commit e35cab2408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 8 deletions

View File

@ -153,10 +153,7 @@ mod types;
/// ///
/// println!("{}", styled_content); /// println!("{}", styled_content);
/// ``` /// ```
pub fn style<'a, D: 'a>(val: D) -> StyledContent<D> pub fn style<D: Display>(val: D) -> StyledContent<D> {
where
D: Display + Clone,
{
ContentStyle::new().apply(val) ContentStyle::new().apply(val)
} }

View File

@ -132,11 +132,11 @@ impl<D: Display> Display for StyledContent<D> {
} }
} }
impl<D: Display + Clone> Colorize<D> for StyledContent<D> { impl<D: Display> Colorize<D> for StyledContent<D> {
impl_colorize_callback!(def_color_generic!(())); impl_colorize_callback!(def_color_generic!(()));
} }
impl<D: Display + Clone> Styler<D> for StyledContent<D> { impl<D: Display> Styler<D> for StyledContent<D> {
impl_styler_callback!(def_attr_generic!(())); impl_styler_callback!(def_attr_generic!(()));
} }

View File

@ -17,7 +17,7 @@ use super::StyledContent;
/// let styled_text = "Red foreground color on blue background.".red().on_blue(); /// let styled_text = "Red foreground color on blue background.".red().on_blue();
/// println!("{}", styled_text); /// println!("{}", styled_text);
/// ``` /// ```
pub trait Colorize<D: Display + Clone> { pub trait Colorize<D: Display> {
fn black(self) -> StyledContent<D>; fn black(self) -> StyledContent<D>;
fn dark_grey(self) -> StyledContent<D>; fn dark_grey(self) -> StyledContent<D>;
fn red(self) -> StyledContent<D>; fn red(self) -> StyledContent<D>;
@ -66,7 +66,7 @@ pub trait Colorize<D: Display + Clone> {
/// println!("{}", "Underlined text".underlined()); /// println!("{}", "Underlined text".underlined());
/// println!("{}", "Negative text".negative()); /// println!("{}", "Negative text".negative());
/// ``` /// ```
pub trait Styler<D: Display + Clone> { pub trait Styler<D: Display> {
fn reset(self) -> StyledContent<D>; fn reset(self) -> StyledContent<D>;
fn bold(self) -> StyledContent<D>; fn bold(self) -> StyledContent<D>;
fn underlined(self) -> StyledContent<D>; fn underlined(self) -> StyledContent<D>;