Open
Description
path()
returns &str
which means it is never missing. Then why does path_and_query()
return Option<&str>
instead of &str
? In other words, if the path is never missing then how can path_and_query()
ever be missing? Under what circumstances would path_and_query()
return None
?
path()
returns *
when the URI is *
. This seems really error prone. Regardless, what does path_and_query()
return when path() returns *
? This should be documented.
I would expect that url.path_and_query().unwrap().starts_with(url.path())
never panics and is always true, and that url.path_and_query().unwrap() == url.path() + url.query().map(|q| "?" + q)
never panics and is always true. That is, I would expect that url.path_and_query()
never returns None
.