Making changes to to project dependencies when using Cargo


#1

If I am using Cargo and I need to make changes to a dependent project downloaded via Cargo. What are the best workflow practices to make this easy? These changes may be temporary (extra logging) or permanent (bug fix).

Lets say crate A uses crate B from crates.io Right now, If I make the changes in my registry cache (.cargo dir) to crate B and recompile crate A, calling cargo does not trigger a recompile of crate B.


#2

Clone the dependency’s code and use an dependency override to point to the cloned directory.

If it is a direct dependency you could also point it to the cloned directory or its git repository directly.