Skip to content

b-async-await temporary value is freed at the end of this statement #41

@snmpboy

Description

@snmpboy

These lines (any with &get_path)

let fut1 = Box::new( Http::get(&get_path(0)));

return this error

  • temporary value is freed at the end of this statement
    ---- coercion requires that borrow lasts for 'static

I did find a solution but I have yet to understand why it works, + use<>

impl Http { pub fn get(path: &str) -> impl Future<Output = String> + use<> { HttpGetFuture::new(path) } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions