Skip to main content

nearest_miss

Function nearest_miss 

Source
pub fn nearest_miss<S: AsRef<str>>(
    lines: &[S],
    block: &[String],
) -> Option<NearestMiss>
Expand description

Report the best partial alignment of an unmatched block against lines: the start with the longest run of matching leading block lines (ties go to the earliest). When no line equals the block’s first line at all, falls back to a whitespace-insensitive scan of that first line, so indentation drift — the most common anchor failure — is still diagnosed.