In my driving lessons I got told to swerve for humans. Pedestrians and cyclists are the least protected participants in traffic. If you swerve and hit another car, the resulting crash will cause a lot of damage, but injuries to humans will likely be much less severe, if they even happen.
Animals, especially small ones are a different matter. Using the same argument, it is better to risk hitting the animal than risking sverving into other traffic.