Convert main from async to sync again
* Make entry point synchronous and switch to global runtime instead. * Switch all futures::block_on() to global runtime. * Fix formatting.
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -117,8 +117,15 @@ struct UserDataInner {
|
||||
pub cmd: CommandManager,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), String> {
|
||||
lazy_static!(
|
||||
/// The global Tokio runtime for running asynchronous tasks.
|
||||
static ref ASYNC_RUNTIME: tokio::runtime::Runtime = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap();
|
||||
);
|
||||
|
||||
fn main() -> Result<(), String> {
|
||||
register_backtrace_panic_handler();
|
||||
|
||||
let backends = {
|
||||
|
||||
Reference in New Issue
Block a user