You have used the "direct substitution" method of limit evaluations. It works in this case, but not always.

Consider

And take the limit as x approaches -2. You'll find that you get 0/0, an indeterminate form.

In this example, you would factor to get "x - 2" (when x is not equal to 2) and then directly substitute.

But so far, you haven't done anything wrong!