diff options
author | Shoelace <pierre.leidbring@gmail.com> | 2021-05-19 21:44:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 22:44:58 +0300 |
commit | 2a23bd20440b0d1a359c6bb4385b6771f2657a3b (patch) | |
tree | ec4052da5dff822c70ab20216298fe5be4abfeb7 /src/main.rs | |
parent | b1d81bf8c936509b6f83b2eac98da8ae72e0a4e3 (diff) |
Threaded to async (#58)
* Add async deps
* Rename blocks to 'BlockManager'
* Refactor "Blocks" to own module
* Make all util fn async
* Remove stray println
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index a2ed5d0..3cfd2e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,12 +2,17 @@ mod config; mod run; mod types; mod utils; +mod blockmanager; + use std::env; use std::process; +use blockmanager::BlockManager; + use lazy_static::initialize; -fn main() { +#[async_std::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { initialize(&config::CONFIG); @@ -17,6 +22,7 @@ fn main() { process::exit(1); }; - let blocks = types::Blocks::new(); - run::run(blocks); + let blocks = BlockManager::new(); + run::run(blocks).await; + Ok(()) } |