When did the infield fly rule become a rule in baseball?

The infield fly rule came into existence in 1895. However, the rule stated that it was only in effect when there was one out. This was changed in 1901 to include being in effect when there were no outs as well as when there was one out.