indentation/macros/
mod.rs1
2
3#[macro_export]
5macro_rules! indent_fmt {
6 ($dst:expr, $($arg:tt)*) => {
7 $dst.write_fmt($crate::format_args!($($arg)*))
8 };
9}
10
11#[macro_export]
13macro_rules! indent_write {
14 ($dst:expr, $($arg:tt)*) => {
15 $dst.write_fmt($crate::format_args!($($arg)*))
16 };
17}
18
19#[macro_export]
21macro_rules! wrap_display {
22 ($($t:ty),*) => {
23 $(
24 impl core::fmt::Display for $t {
25 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
26 IndentFormatter::wrap(self, f)
27 }
28 }
29 )*
30 };
31}