[][src]Function bloguen::util::newline_pad

pub fn newline_pad(val: &mut String, min_before: usize, min_after: usize)

Insert enough newlines at the start and end of the string to reach the specified count.

Examples

let mut data = "\nHenlo!\n".to_string();
newline_pad(&mut data, 0, 2);
assert_eq!(data, "\nHenlo!\n\n");