Q:

Reviewing edit where code has been corrected

I have noticed some users are approving suggested edits where the editor has changed the code of the post, to correct it.  Example 1 Example 2
I thought that posts should not have code corrections as such, but instead be downvoted and, possibly left a comment. 
In this example I have downvoted the answer, left a comment, and provided an answer that does not plagiarize the existing answer.   

A:

I've noticed that, on answers, there's a little more lenience as far as code edits go. 
The justification for question code edits is that said bad code could be present in their actual code.  However, with answers, this doesn't make much sense.  Minor edits like this can be approved, to a very limited extent.  
I personally don't mind someone changing Sting to String.  Additionally, the capitalization issue is... not really all that relevant.  I may have improved the edit to remove the capitalization changes, but when it comes down to it, there would be no difference.  
I would likely have approved this edit.  However, if there were no active suggested edit, I would likely just have commented.  Downvoting is particularly important for entirely wrong answers, which this isn't.  The author could just correct this. 
If you see someone make a significant change to the code of a question or answer, and (for some reason) the suggestion is approved, feel free to roll it back, since it's not a valid edit.