Skip to main content

classify_line

Function classify_line 

Source
pub fn classify_line(line: &str) -> LineContext
Expand description

Classify the context of a single line.

Returns the dominant context type. A line can only have one dominant context. Priority: Comments > Code > Strings. (Comments take precedence because even println!("//"); is still code, but a line that is // comment is unambiguously a comment. Code takes precedence over Strings because a line like println!("hello") is executable code, not merely a string literal.)