1 unstable release

Uses old Rust 2015

0.1.0 Mar 21, 2018

#25 in #indentation

Download history 366/week @ 2024-07-24 323/week @ 2024-07-31 226/week @ 2024-08-07 244/week @ 2024-08-14 198/week @ 2024-08-21 358/week @ 2024-08-28 287/week @ 2024-09-04 232/week @ 2024-09-11 299/week @ 2024-09-18 143/week @ 2024-09-25 143/week @ 2024-10-02 127/week @ 2024-10-09 178/week @ 2024-10-16 112/week @ 2024-10-23 126/week @ 2024-10-30 80/week @ 2024-11-06

517 downloads per month
Used in 2 crates

Custom license

7KB
123 lines

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

No runtime deps