error[E0728]: `await` is only allowed inside `async` functions and blocks
--> src/main.rs:8:20
|
7 | fn main() {
| ---- this is not `async`
8 | println!("{}", init().await);
| ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
How to fix this error without using a third-party thread pool?
my Rust version is rustc 1.45.2 (d3fb005a3 2020-07-31)
You don't need a thread pool, but you do need an executor. It might be single-threaded, no problem.
And if you don't want to use an external one, well, just write your own! If you're really interested, check this material - the whole blog is focused on OS building, but this exact text might be helpful alone.