Debian Codegraph @

/

debian rust-indent 0.1.1+dfsg-1debian librust-indent-dev debian librust-indent+default-dev debian librust-indent-0-dev debian librust-indent-0+default-dev debian librust-indent-0.1-dev debian librust-indent-0.1+default-dev debian librust-indent-0.1.1-dev debian librust-indent-0.1.1+default-dev cargo indent 0.1.1 debianjsonmakefilemarkdownrustrust-c-abishelltoml 15 files · 114 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • cargo, debhelper-compat, libstd-rust-dev, rustc
README (full)

indent

Crates.io Crates.io docs.rs Libraries.io dependency status for latest release Lines of code REUSE Compliance

This crate provides 4 functions useful for inserting a multiline string into an already indented context in another string:

  • indent_by: Indents every line that is not empty by the given number of spaces, starting from the second line.
  • indent_with: Indents every line that is not empty with the given prefix, starting from the second line.
  • indent_all_by: Indents every line that is not empty by the given number of spaces.
  • indent_all_with: Indents every line that is not empty with the given prefix.

Examples

fn main() {
    let string = "line one

line two
";
    assert_eq!("line one\n\n  line two\n", indent::indent_by(2, string));
}

License

Mozilla Public License 2.0

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed under the Mozilla Public License 2.0, without any additional terms or conditions.

dir .reuse/
dir LICENSES/
dir debian/
dir src/
file .cargo_vcs_info.json
file .gitignore
file Cargo.toml
file Cargo.toml.orig
file README.md