frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

Add support for replaced source in Cargo config.toml #86

Closed nc7s closed 1 year ago

nc7s commented 1 year ago

Solves #44. The method name could be discussed - I just made up one.

kornelski commented 1 year ago

Thanks!

I think it should be in the new_cargo_default, instead of requiring every user of the crate to support it manually.

It would be nice if it searched for the config in the same way as cargo does.

nc7s commented 1 year ago

Where to put this is up to you ;)

It's not in the same way in regard to other kinds of sources other than registry. Kinda late here, will try implementing them later.

nc7s commented 1 year ago

Not sure what Index::with_path() is about; it seems to be a Git source in cargo's terms?

kornelski commented 1 year ago

I'd leave it just for the new_cargo_default. Other methods don't promise to behave like Cargo. If someone gives a custom path, then it's their problem.

nc7s commented 1 year ago

Then what exactly is "search for the config in the same way as cargo does"?

kornelski commented 1 year ago

https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure

nc7s commented 1 year ago

Ah, can't imagine how I ignored this… will do.