Skip to content

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

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

    second editionIssues that should be considered for an eventual second edition of the book

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions