Reputation: 315
I want to clone the tokio
library and make a few changes to it, then use it in another project, just like I would if I had specified tokio
as a dependency in my Cargo.toml
.
How would I go about doing that?
Upvotes: 2
Views: 1263
Reputation: 42688
As an alternative, if instead of local dev, you want to use git, you could fork the repo an use reference it:
tokio = { git = "https://github.com/your-user/tokio" }
Take a look at the documentation on how to specify dependencies
Upvotes: 3
Reputation: 169008
You could use a path dependency for this. Paths are interpreted as relative to the Cargo.toml
they appear in, so you have a few options:
Have your tokio fork as a subdirectory tokio
in your project, or symlinked there:
[dependencies]
tokio = { path = "tokio" }
Have your tokio fork live somewhere else in your home directory:
[dependencies]
tokio = { path = "/home/youruser/tokio-fork" }
Or wherever else makes the most sense for you.
Upvotes: 6