You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
Its awkward and exposing of implementation details. I've seen user confusion akin to "Why does rendering need to modify the app?"
Other uses of this API, like clap_generate, need to use the hidden _build
Expected Behaviour
The types are clean and understandable for a user without ambiguous "modify after build"
Additional Context
I propose we add a struct AppParser that derefs to App.
get_matches will consume App and use _build (only build what is needed for parsing)
App::build(self) -> AppParser will call _build_all
Contains all of the existing &mut functions, but without the mut
We can implement the additions without breaking behavior; we just add deprecations. Then on the next breaking release, we remove the deprecated behavior.
Debug Output
No response
The text was updated successfully, but these errors were encountered:
Comment by pksunkara Tuesday Oct 19, 2021 at 19:08 GMT
Same issue as print_*_help and write_*_help methods. I wanted them to be non-mut but couldn't find a way to do it without quickly blowing up the scope of it. IIRC there were some discussions around this when those signatures were implemented which might be useful here.
Issue by epage
Tuesday Oct 19, 2021 at 15:33 GMT
Originally opened as clap-rs/clap#2911
Please complete the following tasks
Rust Version
rustc 1.55.0 (c8dfcfe04 2021-09-06)
Clap Version
master
Minimal reproducible code
Steps to reproduce the bug with the above code
Program with the
&mut
APIActual Behaviour
Its awkward and exposing of implementation details. I've seen user confusion akin to "Why does rendering need to modify the app?"
Other uses of this API, like
clap_generate
, need to use the hidden_build
Expected Behaviour
The types are clean and understandable for a user without ambiguous "modify after build"
Additional Context
I propose we add a
struct AppParser
that derefs toApp
.get_matches
will consumeApp
and use_build
(only build what is needed for parsing)App::build(self) -> AppParser
will call_build_all
&mut
functions, but without themut
We can implement the additions without breaking behavior; we just add deprecations. Then on the next breaking release, we remove the deprecated behavior.
Debug Output
No response
The text was updated successfully, but these errors were encountered: