error E0495 cannot infer an appropriate lifetime for autoref due to co

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
--> src/plugs/tinder/mod.rs:59:73
|
59 | let created_chats_fetching = wrap_future::<_, Self>(self.client.fetch_chats())
| ^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 48:5...
--> src/plugs/tinder/mod.rs:48:5
|
48 | / fn handle(&mut self, message: ClientAuthorized, ctx: &mut actix::Context<Self>) {
49 | | message.0
50 | | .map_or_else(
51 | | |_| {
... |
68 | | ctx.spawn(created_chats_fetching);
69 | | }
| |_____^
note: ...so that reference does not outlive borrowed content
--> src/plugs/tinder/mod.rs:59:61
|
59 | let created_chats_fetching = wrap_future::<_, Self>(self.client.fetch_chats())
| ^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the type `actix::fut::map::Map<actix::fut::FutureWrap<impl futures::Future, plugs::tinder::TinderPlug>, [closure@src/plugs/tinder/mod.rs:60:18: 67:14]>` will meet its required lifetime bounds
--> src/plugs/tinder/mod.rs:68:13
|
68 | ctx.spawn(created_chats_fetching);
| ^^^^^