Today I'm gonna be giving you some directions on how to root the HTC Desire 510.
1. What your gonna need is your phone, a usb, and a pc. (I used my xperia z as my pc)
2 Your gonna need to download [THIS]. This is the recovery image your gonna need. Just download that and put the file in a folder on your desktop or somewhere you'll remember.
3. Next your gonna want to reboot your phone into fastboot and connect it to your pc.
4. Next on your pc pull up cmd. (search cmd in the start menu) and type "fastboot devices" without the quotes and hit enter. If it shows your device your ready to move on.
5. Now your going to want to change your directory to where the image you downloaded is with a command similar to this "cd C:\users\xxx\desktop\recovery folder". Next rename the image to something simple like flash.img and type this into cmd "fastboot flash recovery flash.img" after doing that you should be able to boot into twrp from the hboot menu on your device.
6. Next on your computer download the su binary zip here. After downloading it reboot your device and copy it to your internal storage and reboot back to your recovery. Then in your recovery go find the supersu-v2.16.zip and flash it then reboot normally. Your device should now be rooted.