Skip to content

Allow Client::get(&Url) #412

@dbrgn

Description

@dbrgn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions