#rustlang annoyance of the day:
Can't write
return (foo, foo.len());
Can write
return (foo.len(), foo);
So instead write:
let len = foo.len();
return (foo, len);
Would be nice if the compiler re-ordered things, given the move can't actually happen before the len call.
-
-
Replying to @illicitonion
Not sure if this is something that might be covered under the non-lexical lifetimes umbrella.
2 replies 0 retweets 0 likes
Replying to @passy @illicitonion
It’s either that or two-phase borrows
8:07 AM - 17 Mar 2018
0 replies
0 retweets
1 like
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.