mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-14 14:46:37 +00:00
cargo fmt binstalk-registry/src/lib.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
46291afd3a
commit
49f3f6a2ab
1 changed files with 7 additions and 3 deletions
|
@ -204,7 +204,9 @@ impl Registry {
|
|||
pub fn url(&self) -> Result<MaybeOwned<'_, Url>, UrlParseError> {
|
||||
match self {
|
||||
#[cfg(feature = "git")]
|
||||
Registry::Git(registry) => Url::parse(®istry.url().to_string()).map(MaybeOwned::Owned),
|
||||
Registry::Git(registry) => {
|
||||
Url::parse(®istry.url().to_string()).map(MaybeOwned::Owned)
|
||||
}
|
||||
Registry::Sparse(registry) => Ok(MaybeOwned::Borrowed(registry.url())),
|
||||
}
|
||||
}
|
||||
|
@ -219,8 +221,10 @@ impl Registry {
|
|||
};
|
||||
|
||||
Ok(match (registry.as_str(), source_type) {
|
||||
("https://index.crates.io/", SourceType::Sparse) |
|
||||
("https://github.com/rust-lang/crates.io-index", SourceType::Git) => CrateSource::cratesio_registry(),
|
||||
("https://index.crates.io/", SourceType::Sparse)
|
||||
| ("https://github.com/rust-lang/crates.io-index", SourceType::Git) => {
|
||||
CrateSource::cratesio_registry()
|
||||
}
|
||||
_ => CrateSource {
|
||||
source_type,
|
||||
url: MaybeOwned::Owned(registry.into_owned()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue