Crate pure_lines

Crate pure_lines 

Source
Expand description

A tool that beautify multiple lines.

§Basic example

let doc = " \t\n    hello\n    world!";
assert_eq!(pure_lines::pure(doc),String::from("hello\nworld!"));

§Example with prefix

let doc = " \t\n    hello\n    world!";
assert_eq!(pure_lines::pure_with(doc,"> "),String::from("> hello\n> world!"));

Functions§

pure
Trim first line if empty, and trim min indent.
pure_with
Trim first line if empty, and trim min indent, and add prefix to every lines.