Skip to content

Commit

Permalink
lib: Dispatch to monomorphic function
Browse files Browse the repository at this point in the history
I was looking at `cargo bloat` and this showed up near the top twice.
It's a large function and only the option parsing needs to be generic.
  • Loading branch information
cgwalters committed Aug 16, 2023
1 parent 2c380ae commit 9e37e76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,10 @@ where
I: IntoIterator,
I::Item: Into<OsString> + Clone,
{
let opt = Opt::parse_from(args);
run_from_opt(Opt::parse_from(args)).await
}

async fn run_from_opt(opt: Opt) -> Result<()> {
match opt {
Opt::Tar(TarOpts::Import(ref opt)) => tar_import(opt).await,
Opt::Tar(TarOpts::Export(ref opt)) => tar_export(opt),
Expand Down

0 comments on commit 9e37e76

Please sign in to comment.