Not a recent experience, but...
I spent a month in Rio/SP 15 years ago on my first trip to Brazil. While it's been 10 years since my last visit, I always enjoyed my trips, but did find a fair amount of petty crime in Rio.
You'll find pickpockets, scamming taxi's and other huge city nonsense lots of other places.
Even when going out late at night in Rio alone I never felt unsafe, but you've got to use common sense. Don't use ATM's in desolate/dangerous areas. Don't bring more money than you're willing to lose. And certainly if being robbed, just give your valuables up.
And number 1 Rio advice; don't wear nice shoes walking near the beach!