Fixed some variables being unnecessarily mutable
### Changes
Some variables are marked `mut` when they don't need to be. This PR changes those variables to no longer be `mut`.
### Context
PR on https://github.com/rust-lang/rust/pull/43582
tl:dr; There's a bug with the mutability checker that sometimes marks mutable ref variables as being used when they're not.