Function calc_right_whitespace_with_tabstops

Source
pub fn calc_right_whitespace_with_tabstops(
    source: &str,
    indent: i32,
) -> (usize, usize)
Expand description

Calculate trailing whitespace with total length of indent.

See cut_right_whitespace_with_tabstops for algorithm and details.

Returns number of spaces and number of bytes to cut from the end.

assert_eq!(calc_right_whitespace_with_tabstops("\t\t", 6), (2, 1));