Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Very weird borrow checker error #10

Closed
@rubdos

Description

@rubdos

Hi! Thanks for this cool crate. I just started testing things out, and seems to work as advertised so far, except for this:

I have a type (MapMessage) with a method get_string(&self, &str) -> Result<String>, which I call in a #[async] method. The following works:

let a = msg.get_string("abc")?;
Ok(ResultType {
    a = a,
})

but

Ok(ResultType {
    a = msg.get_string("abc")?,
})

Says that msg only lives to the last line, and not on line 2.

If you want more context, it is this method which I am trying to rewrite. For now I can use the temporary let bindings, but it'd be nicer to have the getter in the constructor.

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