MCPcopy Create free account
hub / github.com/apache/datafusion / split_glob_expression

Function split_glob_expression

datafusion/datasource/src/url.rs:491–507  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

489/// permits `/` as a path delimiter even on Windows platforms.
490#[cfg(not(target_arch = "wasm32"))]
491fn 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)]
510mod tests {

Callers 1

parse_pathMethod · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…