mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-14 22:56:37 +00:00
Add support for Source::Sparse
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
fc32a1ca61
commit
68b9519527
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,7 @@ impl From<&CrateInfo> for CrateVersionSource {
|
||||||
Git => Source::Git(url),
|
Git => Source::Git(url),
|
||||||
Path => Source::Path(url),
|
Path => Source::Path(url),
|
||||||
Registry => Source::Registry(url),
|
Registry => Source::Registry(url),
|
||||||
|
Sparse => Source::Sparse(url),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +41,7 @@ pub enum Source<'a> {
|
||||||
Git(MaybeOwned<'a, Url>),
|
Git(MaybeOwned<'a, Url>),
|
||||||
Path(MaybeOwned<'a, Url>),
|
Path(MaybeOwned<'a, Url>),
|
||||||
Registry(MaybeOwned<'a, Url>),
|
Registry(MaybeOwned<'a, Url>),
|
||||||
|
Sparse(MaybeOwned<'a, Url>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> From<&'a CrateSource> for Source<'a> {
|
impl<'a> From<&'a CrateSource> for Source<'a> {
|
||||||
|
@ -52,6 +54,7 @@ impl<'a> From<&'a CrateSource> for Source<'a> {
|
||||||
Git => Self::Git(url),
|
Git => Self::Git(url),
|
||||||
Path => Self::Path(url),
|
Path => Self::Path(url),
|
||||||
Registry => Self::Registry(url),
|
Registry => Self::Registry(url),
|
||||||
|
Sparse => Self::Sparse(url),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,6 +128,7 @@ impl fmt::Display for Source<'_> {
|
||||||
Source::Git(url) => write!(f, "git+{url}"),
|
Source::Git(url) => write!(f, "git+{url}"),
|
||||||
Source::Path(url) => write!(f, "path+{url}"),
|
Source::Path(url) => write!(f, "path+{url}"),
|
||||||
Source::Registry(url) => write!(f, "registry+{url}"),
|
Source::Registry(url) => write!(f, "registry+{url}"),
|
||||||
|
Source::Sparse(url) => write!(f, "sparse+{url}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue