4 ms·
Readability is very often nothing else but habit - code which looks like code you've seen often enough looks well. Case in point: The first example is just gibb
by sgift 7y ago
Readability is very often nothing else but habit - code which looks like code you've seen often enough looks well. Case in point: The first example is just gibberish to me and I needed the second one to decipher it.
Also, I would write the second example different:
let r: Vec<_> = v.iter().map(|(x,_)| x).collect();
In my opinion that's superior in readability to both of your examples, but probably also only because I'm used to it.
- deleted 7y ago[deleted]
- edflsafoiewq 7y agoYour r has a different type.