Methods like `Iterator::any` borrow the iterator mutably, which is not allowed within a pattern guard and will fail to compile. This commit prevents clippy from suggesting this type of change. Closes #3069