Folks who are not using @rustlang (yet), can you quickly grasp what this code does? Is this a good style for an example targeting beginners? What would you write?https://github.com/killercup/quicli/pull/35 …
-
Show this thread
-
Replying to @killercup @rustlang
i'm not sure what level of beginners you are targeting but i would avoid chaining all those functions. if you assign stuff to variables the variable names can help "self-document" what the result of each function is
2 replies 0 retweets 1 like -
also i think that that main macro is a special part of this crate- is it required? that might also throw some people off
1 reply 0 retweets 0 likes -
Yeah, it's part of the crate. It sets up argument parsing and logging, and wraps the block in a function so you can use ? (it even appends `Ok(())`)
1 reply 0 retweets 1 like -
Replying to @killercup @rustlang
you might link to the ? operator docs. in my experience its a little odd for beginners at first but they do come to love it :D
3 replies 0 retweets 2 likes
Yeah I remember coming across `?` in rust and thinking "how do I Google this?"
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.