yansi/macros.rs
1macro_rules! style_builder_for {
2 ($T:ty, |$s:ident| $props:expr, $($name:ident: $property:ident),*) => ($(
3 #[doc = concat!(
4 "Enables the _", stringify!($name), "_ style on `self`.\n",
5 "```rust\n",
6 "use yansi::Paint;\n",
7 "\n",
8 "println!(\"Using ", stringify!($name), ": {}\", ",
9 "Paint::new(\"hi\").", stringify!($name), "());\n",
10 "```\n"
11 )]
12 #[inline]
13 pub fn $name(self) -> $T {
14 let mut $s = self;
15 $props.set(Property::$property);
16 $s
17 }
18 )*)
19}