Skip to main content

fuzzy_line_match

Function fuzzy_line_match 

Source
fn fuzzy_line_match(content: &str, needle: &str) -> Option<(usize, usize)>
Expand description

Find a unique block of lines in content whose whitespace-trimmed text equals the trimmed lines of needle (ignoring indentation and blank lines around the block). Returns the byte range [start, end) of that block, or None if there is not exactly one match.