I agree. Dakar is a nice city and not unsafe by African standards. But Africa does require a few new “rules of the road”.
Basically, try not to take taxis you have not pre-booked. On arrival, there is no substitute for pre-arranged hotel taxi; thereafter, use the hotel to arrange or provide taxis if you can, especially after dark. Also, always agree the fare before you get in, as not many taxis have meters (and I always ask the concierge what a realistic fare for given trips would be).
One tip you might like to have for less savoury places than Dakar: when you order the hotel car to pick to up at the airport, ask the man with the sign to put up a code word (eg your company name), and then when you meet him, ask him to give you your personal name. The reason for this is that at less safe airports in Africa, bogus taxi drivers look around to see the names of people being waited for, write a sign using one of thir names, and then try to stand nearer the exit where you come out. Then when you see them they look all authentic, you get into their car, and god knows where you might end up or how much it will cost you to get out of the mess you are in.
Safe travels, and enjoy Dakar