indent_with

Function indent_with 

Source
pub fn indent_with<'a, S, T>(prefix: S, input: T) -> String
where S: Into<Cow<'a, str>>, T: Into<Cow<'a, str>>,
Expand description

Indents every line that is not empty with the given prefix, starting from the second line.

The first line of the string is not indented so that it can be placed after an introduction sequence that has already begun the line.

ยงExamples

assert_eq!(format!("items:{}", indent::indent_with("- ", "\nfoo\nbar\n")),
"items:
- foo
- bar
")

For the version that also indents the first line, see indent_all_with.