Skip to content

Passing None for data results in compile error #1

Closed
@jwilm

Description

@jwilm

request is declared as

pub fn request<S, D>(method: Method, url: &str, data: Option<S>) -> Result<Option<D>>

The compiler errors when data is None because now the type S is undefined.

error: unable to infer enough type information about `_`; type annotations or generic parameter binding required

There is a failing test here which demonstrates the desired behavior.

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