Dear rust devs on twitter, is there a better way to do this? This seems... verbose lol. But still better than what most of my CLIs with subcommands look like :P https://github.com/yoshuawuyts/playground-structopt/blob/master/src/main.rs#L35-L69 …
-
-
Replying to @yoshuawuyts
you can replace the `let opts = …` dance you do for printing with `opts @ …` in front of the pattern IIRC (and also write the pattern on one line but rustfmt might disagree)
2 replies 0 retweets 1 like -
Replying to @killercup @yoshuawuyts
Oh and you can use doc comments (`/// foo`) instead of `about = "foo"`!
1 reply 0 retweets 1 like -
Replying to @killercup
Ohh, the comments thing is super neat! That definitely makes things easier :D I'm having trouble reading up on the @ symbol tho; is there a keyword I could look for so I can read up on it further? Compiler doesn't help with trial / error programming here, haha :P
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
Hmm this is more of a niche feature than expected. The reference has a single example: https://doc.rust-lang.org/reference/expressions/match-expr.html …
2 replies 0 retweets 1 like
hopped onto IRC, and @steveklabnik pointed me to https://doc.rust-lang.org/book/second-edition/ch18-03-pattern-syntax.html#-bindings … :D
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.