Drop Rocket inside the tokio async context when using launch

Moves error printing and the implicit drop inside the tokio runtime
when using the `#[launch]` attribute.
This commit is contained in:
Matthew Pomes 2024-07-07 17:35:11 -05:00 committed by Sergio Benitez
parent 9496b70e8c
commit 02680076eb
1 changed files with 3 additions and 1 deletions

View File

@ -113,7 +113,9 @@ impl EntryAttr for Launch {
#[allow(dead_code)] #f
#vis #sig {
#_error::Error::report(::rocket::async_main(#launch))
::rocket::async_main(async move {
#_error::Error::report(#launch.await)
})
}
))
}