If x increases by 2 from -2 to 0, y increases from 0 to 2.
The slope is defined as rise / run, which in this case is 2-0
---------- = 2/2 = 1.
0-[-2]
I wouldn't bother with this subtraction for this particular problem. I'd just notice that if the run is 2, the rise is 2, and thus the slope is 2/2 = 1.