Open KSXGitHub opened 1 year ago
4.3.8
Box of an unsized type is often smaller than its owned counterpart. And it is cheaper to clone Rc and Arc than cloning the owned version.
Box
Rc
Arc
Allow parsing arguments directly to smart pointer types such as Box, Rc, and Arc. For example:
#[derive(Clone, Parser)] struct Args { #[clap(long, short)] tag: Arc<[Box<str>]>, // instead of Vec<String> files: Arc<[Box<Path>]>, // instead of Vec<PathBuf> }
No response
Please complete the following tasks
Clap Version
4.3.8
Describe your use case
Box
of an unsized type is often smaller than its owned counterpart. And it is cheaper to cloneRc
andArc
than cloning the owned version.Describe the solution you'd like
Allow parsing arguments directly to smart pointer types such as
Box
,Rc
, andArc
. For example:Alternatives, if applicable
No response
Additional Context
No response