Implement styler traits for &'a str
(#449)
This commit is contained in:
parent
9d9dfeae26
commit
13e0d012ce
14
src/style.rs
14
src/style.rs
@ -160,13 +160,23 @@ where
|
||||
}
|
||||
|
||||
impl_colorize!(String);
|
||||
impl_colorize!(&'static str);
|
||||
impl_colorize!(char);
|
||||
|
||||
// We do actually need the parentheses here because the macro doesn't work without them otherwise
|
||||
// This is probably a bug somewhere in the compiler, but it isn't that big a deal.
|
||||
#[allow(unused_parens)]
|
||||
impl<'a> Colorize<&'a str> for &'a str {
|
||||
impl_colorize_callback!(def_color_base!((&'a str)));
|
||||
}
|
||||
|
||||
impl_styler!(String);
|
||||
impl_styler!(&'static str);
|
||||
impl_styler!(char);
|
||||
|
||||
#[allow(unused_parens)]
|
||||
impl<'a> Styler<&'a str> for &'a str {
|
||||
impl_styler_callback!(def_attr_base!((&'a str)));
|
||||
}
|
||||
|
||||
/// Returns available color count.
|
||||
///
|
||||
/// # Notes
|
||||
|
Loading…
Reference in New Issue
Block a user