From 392828e60235188286c5213b079cbe878b99aedf Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 16 Aug 2023 14:52:06 -0400 Subject: [PATCH] lib: Dispatch to monomorphic function This mirrors https://github.com/ostreedev/ostree-rs-ext/pull/515 From looking at cargo bloat. Signed-off-by: Colin Walters --- lib/src/cli.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/cli.rs b/lib/src/cli.rs index 857dc9c1b..a099c9297 100644 --- a/lib/src/cli.rs +++ b/lib/src/cli.rs @@ -429,7 +429,11 @@ where I: IntoIterator, I::Item: Into + Clone, { - let opt = Opt::parse_from(args); + run_from_opt(Opt::parse_from(args)).await +} + +/// Internal (non-generic/monomorphized) primary CLI entrypoint +async fn run_from_opt(opt: Opt) -> Result<()> { match opt { Opt::Upgrade(opts) => upgrade(opts).await, Opt::Switch(opts) => switch(opts).await,