Rocket: Use master branch crate in Cargo.toml?

Created on 1 Aug 2018  路  2Comments  路  Source: SergioBenitez/Rocket

How can the master branch of an individual crate be used in the Cargo.toml of a personal project? Cargo.toml requires a link to a git repository per crate. But GitHub provides only a link to the root of the repo.

How would the Cargo syntax look? I'd like something like this:

[package]
...

[dependencies]
rocket = { git = /* URL to rocket crate here */ }
rocket_codegen = { git = /* URL to rocket_codegen crate here */ }
...

[dependencies.rocket_contrib]
git = /* URL to rocket_contrib crate here */
...

I tried using the URL of the dir directly, but that resulted in a 404 (since it's not a direct link to a git repo).

question

Most helpful comment

Simply link to the main repo, it's my understanding that cargo parse's the Cargo.toml at the url pointed to by 'git' parameter to look for repository names

[package]
...

[dependencies]
rocket = { git ="https://github.com/SergioBenitez/Rocket" }
rocket_codegen = { git = "https://github.com/SergioBenitez/Rocket"}
...

[dependencies.rocket_contrib]
git = "https://github.com/SergioBenitez/Rocket"
...

All 2 comments

Simply link to the main repo, it's my understanding that cargo parse's the Cargo.toml at the url pointed to by 'git' parameter to look for repository names

[package]
...

[dependencies]
rocket = { git ="https://github.com/SergioBenitez/Rocket" }
rocket_codegen = { git = "https://github.com/SergioBenitez/Rocket"}
...

[dependencies.rocket_contrib]
git = "https://github.com/SergioBenitez/Rocket"
...

@bytebuddha's response is exactly right! Thanks, @bytebuddha.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucklove picture lucklove  路  4Comments

ndarilek picture ndarilek  路  3Comments

loothood picture loothood  路  4Comments

shssoichiro picture shssoichiro  路  4Comments

marcusball picture marcusball  路  3Comments