1 unstable release

0.1.0 Dec 28, 2024

#371 in Command-line interface

Download history 87/week @ 2024-12-24 2/week @ 2024-12-31

89 downloads per month

MIT license

6KB
133 lines

License Crates.io Doc.rs

paligned

Simple macro for aligned printing.

use paligned::paligned;

paligned! ([
    ["expression","value", "description"],
    ["1 + 1 =", 1 + 1],
    ["foo:", @debug foo, "`@debug` example"],
]);
// expression value          description
// 1 + 1 =    2
// foo:       Foo { val: 1 } `@debug` example

The goal of this crate is to provide a simple, zero-configuration solution for printing several rows with aligned columns. Basically, an alternative to:

println!("expression value  description");
println!("1 + 1 = {}", 1 + 1);
println!("foo:    {:?}", foo);

This macro is minimal on purpose, if you need fancier printing, then (at the cost of extra verbosity) I would recommend:

No runtime deps