How to add a git sublfolder crate as dependency?

Hi,
I am trying to add a non-published(yet) crate that is located in a subfolder of the main crate, but I cannot find the right syntax to use.

I tried the usual git syntax pointing to the subfolder, without success, also tried pointing to the main repo and using "path" for the subfolder, but cargo complained that we cannot combine the two.

I am trying to use this crate here (the askama_axum subfolder):

Any help with the syntax to use

You need to only point to the main repo. In you case that would be:

[dependencies]
askama_axum = { git = "https://github.com/djc/askama" }

Cargo will search the entire repo for a crate matching the name of the dependency.

1 Like

I am 120% sure I had tried that syntax and it failed. But retrying it, it works...
It's Sunday, I'll go rest I think :stuck_out_tongue:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.