What's the common way to explain compiler "I'm not gonna loose the owner"?

69 points sildtm 48 comments

https://preview.redd.it/5jz8c0vl18ge1.png?width=1078&format=png&auto=webp&s=32f8e9e8c00f03f4d485ad86fd6fc5b0532e3f4c

Hi, I'm curious if there are a common solution for such pattern:

For sure it's arguing about borrowed data: borrowed data escapes outside of function

But I'm kinda promising to await the future right after the call. So how to make compiler happy?

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fb957fc46aa784f4e8e676e7fbd1c227