| Crates.io | pretty_balanced |
| lib.rs | pretty_balanced |
| version | 0.1.0 |
| created_at | 2019-04-28 13:52:27.774396+00 |
| updated_at | 2019-04-28 13:52:27.774396+00 |
| description | A library for displaying code in human-readable format. |
| homepage | https://github.com/segeljakt/pretty_balanced |
| repository | https://github.com/segeljakt/pretty_balanced |
| max_upload_size | |
| id | 130706 |
| size | 4,210 |
A library for displaying code in human-readable format.
use pretty_balanced::PrettyBalanced;
fn main() {
println!("{}", "if 3 { foo; bar } else { baz }".pretty_balanced());
}
Output:
if 3 {
foo;
bar
} else {
baz
}
The formatting simply inserts newline and indentation after (){}[]<>; characters.