indented 0.1.0

Format data with indentation
Documentation
  • Coverage
  • 38.46%
    5 out of 13 items documented0 out of 9 items with examples
  • Size
  • Source code size: 17.16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.27 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • peterdelevoryas

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;
    }
}