I like either the first or the last one, as they both express that the two variables are related to each other (the conditional expression and what happens inside of it will change at the same time). Not sure if that's accidental, but if it isn't I think it's a nice property.
-
-
-
Yeah, the third one is "cleanest" by the metrics I normally use, but I find it the hardest to read/follow by a significant margin
- 2 more replies
New conversation -
-
-
Mutable state stays mutable after target state, so if you’re aiming for an API, it might be a source of confusion as to were this data should me modified ? I voted tuples.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You could write an method on the `type_args` type which converts it to a Maybe, like Rails’ `presence`, then `map` over that result. That would remove most of the repetition from the repetition example. http://type_args.nonempty.map |ta| { quote!((#(
#ta),*)) } (Assuming syntax is
)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I like tuple assignment, but: - I think it reads better as a match rather than if - It feels like type_args wants to be an Option, so you can map. I tried a version with an intermediate Option and map repetition, but.. meh, closure noise+quote noise is.. noisypic.twitter.com/goKNaNe9eb
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.