Skip to main content

indent_block

Function indent_block 

Source
pub fn indent_block(block: &str, column: usize) -> String
Expand description

Re-indent block to start every non-empty line at column column. Existing leading whitespace on each line is replaced by exactly column spaces.

Empty lines are preserved as empty (no trailing whitespace), so blank lines inside the block don’t gain spurious indent.

Used to format a generated multi-line YAML block to the indent level the locator reported.