Use iter().map() instead of for loop.
auto merge of #1305 : pradeep90/servo/rule-hash-optimize, r=kmcallister

Changing as per comment in #1274