pretty_printer/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/// A macro to simplify pretty-printing of debug information using `println!`.
///
/// This macro prints the provided value using Rust's pretty print formatting (`{:#?}`),
/// which is particularly useful for printing complex structures in a more readable form.
///
/// # Examples
///
/// ```
/// use pretty_print::pretty_print;
///
/// let my_data = vec![1, 2, 3];
/// pretty_print!(my_data);
/// ```
///
/// This will output:
/// ```text
/// [
///     1,
///     2,
///     3,
/// ]
/// `
#[macro_export]
macro_rules! pretty_print {
    ($val: expr) => {
        println!("{:#?}", $val);
    };
}