Crates.io | indented |
lib.rs | indented |
version | 0.1.0 |
source | src |
created_at | 2018-03-21 06:41:40.6337 |
updated_at | 2018-03-21 06:41:40.6337 |
description | Format data with indentation |
homepage | |
repository | https://github.com/peterdelevoryas/indented.git |
max_upload_size | |
id | 56659 |
size | 17,534 |
Format data with indentation
[dependencies]
indented = "0.1.0"
extern crate indented;
use indented::indented;
fn main() {
let x = "statement";
let y = format!("nested {{\n{};\n}}", indented(&x));
println!("block {{\n{};\n{}\n}}", indented(&x), indented(&y));
}
Output:
block {
statement;
nested {
statement;
}
}