Closed Nemo157 closed 1 year ago
Maybe URLs can generally move to their own module which is always available.
Further, I recommend having a look at tame-index
, which should provide a better experience around sparse indices while not suffering from #133.
tame-index
is actually much less convenient for me, because it returns http::Request
instead of http::request::Builder
, which ureq
doesn't have interop support for, I'd have to manually translate the details. I assume #133 only affects GitIndex
so I should be fine with that.
I'm not sure if a module is necessary for the urls, they could be top-level GIT_URL
and SPARSE_URL
consts, otherwise I guess pub mod urls { const GIT; const SPARSE; }
is what you're imagining? I could prepare a PR for whatever you think best.
Maybe none of these is great after all 😅. What about keeping the existing structure and refactor so that git::URL
is always available? Then it matches with sparse::URL
which is always there as well.
And yes, a PR would be appreciated, thanks for offering.
I'm transitioning
cargo-dl
to use the new sparse feature support, as part of that I want to check the.crate
download caches for both the sparse and git index to avoid having to actually download if the user has the package already. I'm usingcrates_index::local_path_and_canonical_url
to handle the bulk of the local path determination for me and then moving from that to the cache directory. At least at the moment I don't plan to support using the git index, but to get the URL to pass tolocal_path...
I still need to activate the feature (or hardcode my own copy of it).