lol, nevermind -- this doesn't even compile haha. But like actually: is there a better way?
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You could add restructuring
-
*destructuring
- 5 more replies
New conversation -
-
-
I prefer calling `next` multiple times on the iterator instead of using hardcoded indexes.
-
Oh yeah, much better already! Thanks!
End of conversation
New conversation -
-
-
I'd call next instead indexing, but you could maybe use slice matching to set the variables now that it has stabilized!
-
Some day, (needs at least const generics though), I'd love to see ability to collect an iterator to a statically sized array. Then you could assign that array to separate variables with pattern matching. You can do that now with a vec, but that requires a needless allocation.
End of conversation
New conversation -
-
-
std::env::Args is Iterator already, so you don't need the .into_iter() If you only need one or two args you can use something like args().nth(1).unwrap(), etc. Add error handling as you like.
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.