Boosted by rust@mas.to ("Rust tips"):
ericseppanen@hachyderm.io ("Eric Seppanen") wrote:
A #rustlang Cargo workspace trick that I find makes my projects a tiny bit easier:
If you have a workspace with unpublished libraries (e.g. as part of a larger application), and you use "path" dependencies (i.e. `mylib = { path = "../mylib" }`:
You can instead place that in your workspace Cargo.toml:
[workspace.dependencies]
mylib.path = "./mylib"and then use it from crates in the workspace just like any other workspace dependency.
The reason this is nice is that you can move the crate directories around and only have to fix it one time, instead of once for each crate. If you move `mylib`, you only need to change the path in the workspace Cargo.toml. If you move other crates that were consumers of `mylib`, everything still works with no changes at all!