Function split_path

Source
pub fn split_path(path: &str) -> (&str, &str)
Expand description

Split a template path with optional fragment into the path and fragment

If no fragment is found, the fragment will be a empty string

assert_eq!(split_path("index.html"), ("index.html", ""));
assert_eq!(split_path("index.html#child"), ("index.html", "child"));

// whitespace is normalized
assert_eq!(split_path("  index.html  "), ("index.html", ""));
assert_eq!(split_path("  index.html  #  child  "), ("index.html", "child"));