url v2.2.0 has been released which includes a TryFrom<str> for Url impl, which means we can use string literals in our Url examples.
// current
let url = Url::parse("https://github.com/foob").unwrap();
let req = Request::new(url);
// proposed
let req = Request::new("https://github.com/foob");
Both variants will continue to work, and the former case is useful for when dealing with untrusted input. But at least now it should be easier to write examples using Request.
url v2.2.0
has been released which includes aTryFrom<str> for Url
impl, which means we can use string literals in our Url examples.Both variants will continue to work, and the former case is useful for when dealing with untrusted input. But at least now it should be easier to write examples using
Request
.