diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
commit | 4547b622d8d29df964fa2914213088b148c498fc (patch) | |
tree | 9fc6b25f3c3add6b745be9a2400a6e96140046e9 /vendor/yansi/src/macros.rs | |
parent | Releasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz rustc-4547b622d8d29df964fa2914213088b148c498fc.zip |
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/yansi/src/macros.rs')
-rw-r--r-- | vendor/yansi/src/macros.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/yansi/src/macros.rs b/vendor/yansi/src/macros.rs new file mode 100644 index 000000000..b7c0b0339 --- /dev/null +++ b/vendor/yansi/src/macros.rs @@ -0,0 +1,19 @@ +macro_rules! style_builder_for { + ($T:ty, |$s:ident| $props:expr, $($name:ident: $property:ident),*) => ($( + #[doc = concat!( + "Enables the _", stringify!($name), "_ style on `self`.\n", + "```rust\n", + "use yansi::Paint;\n", + "\n", + "println!(\"Using ", stringify!($name), ": {}\", ", + "Paint::new(\"hi\").", stringify!($name), "());\n", + "```\n" + )] + #[inline] + pub fn $name(self) -> $T { + let mut $s = self; + $props.set(Property::$property); + $s + } + )*) +} |