Nobody said 1 gallon rule unless I'm missing something?
Anyway... I think that is a bit small, I would say 20 gallons is better. Or if you already have a 10 gallon and want to keep those fish, I'd remove the cardinals.
Jack: that's perverse and inhumane... nothing lives in 2 gallon puddles in the wild except algae and mosquitoes.