mirror of
https://github.com/ekzhang/bore.git
synced 2025-12-16 03:47:50 +01:00
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:
12
src/main.rs
12
src/main.rs
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user