Can anyone explain why this closure capture is borrow mut?


why count is borrow mut?
count + 1 is an i32 type count is a borrow mut &i32 type , why &i32 = i32?

The borrowing the closure does doesn't change the type of the captured variable. count is of type i32 inside and outside the closure; the &mut i32 is only part of how the compiler implements access to count inside the closure.