Deps: minimize Tokio features (#25)

* Deps: use specific Tokio features

* Deps: run `cargo update`

* Refactor: move CLI-parsing outside Tokio runtime

* Fix: use `parse` over `try_parse`

Clap does special things behind the scenes before it exits.

* Refactor: use `tokio::main` macro for convenience
This commit is contained in:
Basti Ortiz
2022-04-15 02:39:46 +08:00
committed by GitHub
parent 36a56c0d4a
commit b045d8028e
3 changed files with 23 additions and 32 deletions

View File

@@ -47,11 +47,8 @@ enum Command {
}
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
let args = Args::parse();
match args.command {
async fn run(command: Command) -> Result<()> {
match command {
Command::Local {
local_host,
local_port,
@@ -69,3 +66,8 @@ async fn main() -> Result<()> {
Ok(())
}
fn main() -> Result<()> {
tracing_subscriber::fmt::init();
run(Args::parse().command)
}