(line: &str)
| 3321 | } |
| 3322 | |
| 3323 | fn strip_line_comment_code(line: &str) -> String { |
| 3324 | let mut in_string = false; |
| 3325 | let mut in_char = false; |
| 3326 | let mut previous = '\0'; |
| 3327 | let chars: Vec<(usize, char)> = line.char_indices().collect(); |
| 3328 | for (idx, ch) in &chars { |
| 3329 | if *ch == '"' && !in_char && previous != '\\' { |
| 3330 | in_string = !in_string; |
| 3331 | } else if *ch == '\'' && !in_string && previous != '\\' { |
| 3332 | in_char = !in_char; |
| 3333 | } else if !in_string && !in_char && *ch == '/' { |
| 3334 | let next_is_slash = line[*idx + ch.len_utf8()..].starts_with('/'); |
| 3335 | if next_is_slash { |
| 3336 | return line[..*idx].to_string(); |
| 3337 | } |
| 3338 | } |
| 3339 | previous = *ch; |
| 3340 | } |
| 3341 | line.to_string() |
| 3342 | } |
| 3343 | |
| 3344 | fn classify_noexcept_line( |
| 3345 | line: &str, |
no test coverage detected