🏡 index : ~doyle/gitlab-cargo-shim.git

author jordan <jordan@doyle.la> 2022-09-14 11:56:04.0 +01:00:00
committer GitHub <noreply@github.com> 2022-09-14 11:56:04.0 +01:00:00
commit
107e5e6c62b0d07c16197226bace21659be6b23c [patch]
tree
6e5236af4e6625276041d6393c23cd15f2bb8ce5
parent
19aafa0cf39306c063f9d1f7bc5638f9d7514d35
parent
027bd44578b207f88229fdf404d5b7f894b55978
download
107e5e6c62b0d07c16197226bace21659be6b23c.tar.gz

Merge pull request #35 from Eijebong/fix-renamed-deps

Fix dependency renaming in published crates

Diff

 src/metadata.rs | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/metadata.rs b/src/metadata.rs
index b6f39c7..aed0ce9 100644
--- a/src/metadata.rs
+++ a/src/metadata.rs
@@ -26,19 +26,27 @@
        deps: package
            .dependencies
            .into_iter()
            .map(|v| CargoIndexCrateMetadataDependency {
                name: v.name,
                req: v.req,
                features: v.features,
                optional: v.optional,
                default_features: v.uses_default_features,
                target: v.target,
                kind: v.kind,
                registry: Some(v.registry.map_or(
                    Cow::Borrowed("https://github.com/rust-lang/crates.io-index.git"),
                    Cow::Owned,
                )),
                package: v.rename,
            .map(|v| {
                let (name, package) = if let Some(rename) = v.rename {
                    (rename, Some(v.name))
                } else {
                    (v.name, None)
                };

                CargoIndexCrateMetadataDependency {
                    name,
                    req: v.req,
                    features: v.features,
                    optional: v.optional,
                    default_features: v.uses_default_features,
                    target: v.target,
                    kind: v.kind,
                    registry: Some(v.registry.map_or(
                        Cow::Borrowed("https://github.com/rust-lang/crates.io-index.git"),
                        Cow::Owned,
                    )),
                    package,
                }
            })
            .collect(),
        cksum,