Is there a tool to remove unused dependencies from a Cargo file?

149 points solidsciencewastaken

Oftentimes I find myself just copy+pasting a whole dependency block from one file to another, and end up with a lot of unused dependencies in Cargo file.

I feel like there should be a tool that can just see what you're actually using and remove the one's you're not, but I haven't found any after a cursory look. Can anyone point me in the right direction?