It is sometimes useful to parse just the path portion of a URL (path,
query string and fragment) rather than the entire URL.
In theory I could have made Url embed a Path, but that would be a
breaking change and I assume that Servo uses this API. I would be
happy to update the PR to embed Path in Url if that's what people
wanted.
}
}
+ impl FromStr for Path {
+ fn from_str(s: &str) -> Option<Path> {
+ match path_from_str(s) {
+ Ok(path) => Some(path),
+ Err(_) => None
+ }
+ }
+ }
+
/**
- * Format a `url` as a string
+ * Converts a URL from `Url` to string representation.
*
* # Arguments
*