stripmargin

Crates.iostripmargin
lib.rsstripmargin
version0.1.1
sourcesrc
created_at2021-01-16 19:59:48.104327
updated_at2021-01-17 10:37:16.584115
descriptionSimple but elegant multiline string in Rust à la Scala.
homepagehttps://github.com/rami3l/stripmargin
repositoryhttps://github.com/rami3l/stripmargin
max_upload_size
id342916
size6,090
rami3l (rami3l)

documentation

README

stripmargin

Downloads License crates.io docs.rs

A little Rust library that enables you to write multiline strings à la Scala.

Usage

use stripmargin::StripMargin;

// Use '|' to set left margin, 
// and then `.strip_margin()` :)
```rust
assert_eq!(
    r#"Hello,
      |  world!
      |"#
    .strip_margin(),
    "Hello,\n  world!\n",
);
Commit count: 13

cargo fmt