#returning this value requires that `'1` must outlive `'static`

5 messages · Page 1 of 1 (latest)

hallow sandal
#

How do I fix this? ```
error: lifetime may not live long enough
--> src\commands\mod.rs:32:61
|
27 | pub async fn set_commands(&self, http: &Http) -> Result<(), Error> {
| - let's call the lifetime of this reference '1
...
32 | commands.create_application_command(|c| command.create(c));
| ^^^^^^^^^^^^^^^^^ returning this value requires that '1 must outlive 'static

gaunt whale
#

Have you tried adding move to your closure?

hallow sandal
#

I can't move command

#

its inside a Vec<Box<dyn Command>>

#

in &self