I'm using a function that should be passed a reference to a reqwest::Url object. It should then GET that URL.
fn get_resource(url: &Url) {
let client = Client::new();
client.get(url);
}
Unfortunately it seems that this is not possible, because &Url does not implement reqwest::IntoUrl.
Is it really necessary that the Url object is moved into the get method?
Play: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=48cbed79f2143a227c36ec4936a2dff8
I'm using a function that should be passed a reference to a
reqwest::Urlobject. It should then GET that URL.Unfortunately it seems that this is not possible, because
&Urldoes not implementreqwest::IntoUrl.Is it really necessary that the
Urlobject is moved into thegetmethod?Play: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=48cbed79f2143a227c36ec4936a2dff8