Clean up code for unused_must_use lint

We're unnecessarily inferring types twice, and there are two match statements there that could really be just one