refactor: Move a borrow_mut and unwrap out of a loop
refactor: Move a borrow_mut and unwrap out of a loop

aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust