1 个不稳定版本

使用旧的 Rust 2015

0.1.0 2018年3月21日

#9#indent

Download history 425/week @ 2024-04-02 277/week @ 2024-04-09 237/week @ 2024-04-16 205/week @ 2024-04-23 341/week @ 2024-04-30 453/week @ 2024-05-07 378/week @ 2024-05-14 276/week @ 2024-05-21 203/week @ 2024-05-28 259/week @ 2024-06-04 258/week @ 2024-06-11 506/week @ 2024-06-18 348/week @ 2024-06-25 466/week @ 2024-07-02 319/week @ 2024-07-09 398/week @ 2024-07-16

1,627 每月下载量
2 crate 中使用

自定义许可证

7KB
123

indented

使用缩进来格式化数据

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

输出

block {
    statement;
    nested {
        statement;
    }
}

无运行时依赖