Replace explicit match with as_ref().(fixes #1870)
auto merge of #1873 : lpy/servo/issue1870, r=jdm

see #1870