indented

Crates.ioindented
lib.rsindented
version0.1.0
sourcesrc
created_at2018-03-21 06:41:40.6337
updated_at2018-03-21 06:41:40.6337
descriptionFormat data with indentation
homepage
repositoryhttps://github.com/peterdelevoryas/indented.git
max_upload_size
id56659
size17,534
Peter James Delevoryas (peterdelevoryas)

documentation

README

indented

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;
    }
}
Commit count: 0

cargo fmt