Function finalize_current_line

Source
pub fn finalize_current_line(
    output: &mut String,
    words_after_first: &mut Vec<&str>,
    num_extra_spaces: u32,
)
Expand description

Assumes the first word of the line is already at the start of the line, without spaces following it.

ยงExamples

use justify_string::finalize_current_line;

let mut out = String::from("123");
finalize_current_line(&mut out, &mut vec!["12", "1234"], 3);
assert_eq!(out, String::from("123   12  1234"));

If words_after_first is empty, it simply appends extra spaces to the first word.

use justify_string::finalize_current_line;

let mut out = String::from("123");
finalize_current_line(&mut out, &mut vec![], 2);
assert_eq!(out, String::from("123  "));