linecheck 1.1.0

A fast, configurable tool that warns or errors when files exceed a set line count
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub(super) fn msg_json(message: Option<&str>) -> String {
    message.map_or(String::new(), |m| {
        format!(r#","message":{}"#, serde_json::to_string(m).unwrap())
    })
}

pub(super) fn emit_json(items: Vec<String>) {
    println!(
        "{}",
        if items.is_empty() {
            "[]".into()
        } else {
            format!("[\n{}\n]", items.join(",\n"))
        }
    );
}