Skip to content

Commit

Permalink
Merge #1681
Browse files Browse the repository at this point in the history
1681: WIP: Extract subcommands into separate trait r=pksunkara a=CreepySkeleton

Not-yet-working-but-almost-there "multiple traits" approach. More or less done, what's left is to catch some bugs and adapt tests/examples.

For the record: it took so long because of RL stuff (who would have thought?) and because [there was a detailed description of the experience I've had here, but it was deleted because it contained a lot of profanity and emotional notes]. 

As the only person alive that understands how the derive works (if you won't blow your own horn, nobody will do it for you, yeah), I'd like to made a statement: we Do need the refactoring.

Co-authored-by: CreepySkeleton <[email protected]>
  • Loading branch information
bors[bot] and CreepySkeleton authored Feb 12, 2020
2 parents 20cdc83 + ae574df commit 12df8cb
Show file tree
Hide file tree
Showing 48 changed files with 679 additions and 885 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ clap-rs.iml

# Auxiliary files
test-results.test
expanded.rs
clap_derive/expanded.rs
5 changes: 1 addition & 4 deletions clap_derive/src/derives/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ pub struct Attrs {
/// The output of a generation method is not only the stream of new tokens but also the attribute
/// information of the current element. These attribute information may contain valuable information
/// for any kind of child arguments.
pub struct GenOutput {
pub tokens: proc_macro2::TokenStream,
pub attrs: Attrs,
}
pub type GenOutput = (proc_macro2::TokenStream, Attrs);

impl Method {
pub fn new(name: Ident, args: TokenStream) -> Self {
Expand Down
Loading

0 comments on commit 12df8cb

Please sign in to comment.