Skip to main content

detect_protected_lines

Function detect_protected_lines 

Source
pub fn detect_protected_lines(content: &str) -> Vec<usize>
Expand description

Detect lines that should never be toggled: shebang and encoding pragma. Only checks the first two non-blank lines (shebangs are only valid on line 1, PEP 263 encoding pragmas on lines 1-2). Returns 0-based line indices of protected lines.