util: remove unused `with` function
auto merge of #9354 : thestinger/rust/cleanup, r=alexcrichton

I don't see the point of this function, and there are no users.