Skip to content

Return Result from constructors which take TryInto<Url> #303

Open
@yoshuawuyts

Description

@yoshuawuyts

Now that TryFrom<str> for Url has been implemented, using the Url struct is a lot more pleasant. This opens up the possibility again for us to move from a "panic if parsing fails" to returning errors if parsing fails.

// current, panic if the url is malformed
let req = Request::post("https://api.foo.com/berries");

// proposed, throw an error instead
let req = Request::post("https://api.foo.com/berries")?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    semver-majorThis change requires a semver major change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions