Skip to content
Discussion options

You must be logged in to vote

This is probably a basic question, but I don't quite see how do you obtain the names of the struct in order they are declared in the text ?! Just a small conceptual explanation would be enough for me, but got me stuck pondering that.

#[derive(Parser)] activates a compiler plugin, clap_derive and passes a copy of the Rust Tokens for the entire struct to that plugin. We then iterate on them in order to provide this.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@iampi31415
Comment options

Answer selected by iampi31415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants