(path: &str)
| 489 | /// permits `/` as a path delimiter even on Windows platforms. |
| 490 | #[cfg(not(target_arch = "wasm32"))] |
| 491 | fn split_glob_expression(path: &str) -> Option<(&str, &str)> { |
| 492 | let mut last_separator = 0; |
| 493 | |
| 494 | for (byte_idx, char) in path.char_indices() { |
| 495 | if GLOB_START_CHARS.contains(&char) { |
| 496 | if last_separator == 0 { |
| 497 | return Some((".", path)); |
| 498 | } |
| 499 | return Some(path.split_at(last_separator)); |
| 500 | } |
| 501 | |
| 502 | if std::path::is_separator(char) { |
| 503 | last_separator = byte_idx + char.len_utf8(); |
| 504 | } |
| 505 | } |
| 506 | None |
| 507 | } |
| 508 | |
| 509 | #[cfg(test)] |
| 510 | mod tests { |
no test coverage detected
searching dependent graphs…