Nope, you didn't do anything wrong. The idiot behind you did.
Had you hit the pedidiot, even if she darted out in front of you without warning, you would have been 100% responsible. That's because, in any court of law, pedestrians are actually expected to know nothing about the rules and dangers of motorized traffic. They're assumed to be complete morons, because the assumption is usually accurate.
Licensed drivers, however, are expected to know and obey all the rules of the road. One of those rules, a really common one, is that you're always supposed to leave a safe stopping distance between you and whatever is directly in front of you. That's why following too close (tailgating) is against the law everywhere in the civilized world.
When a rear-end collision happens, the vehicle that did the rear-ending is 100% responsible every time, no exceptions and no excuses. If the other idiot had crashed into you from behind, it would have been totally his fault. No matter how he argued against it, no matter how many excuses he came up with, nothing would change that fact.