ZIm/crates/git_hosting_providers/src/git_hosting_providers.rs
Piotr Osiewicz 03c84466c2
chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795)
While this lint is allow-by-default, it seems pretty useful to get rid
of mutable borrows when they're not needed.

Closes #ISSUE

Release Notes:

- N/A
2024-10-07 01:29:58 +02:00

26 lines
870 B
Rust

mod providers;
use std::sync::Arc;
use git::GitHostingProviderRegistry;
use gpui::AppContext;
pub use crate::providers::*;
/// Initializes the Git hosting providers.
pub fn init(cx: &AppContext) {
let provider_registry = GitHostingProviderRegistry::global(cx);
// The providers are stored in a `BTreeMap`, so insertion order matters.
// GitHub comes first.
provider_registry.register_hosting_provider(Arc::new(Github));
// Then GitLab.
provider_registry.register_hosting_provider(Arc::new(Gitlab));
// Then the other providers, in the order they were added.
provider_registry.register_hosting_provider(Arc::new(Gitee));
provider_registry.register_hosting_provider(Arc::new(Bitbucket));
provider_registry.register_hosting_provider(Arc::new(Sourcehut));
provider_registry.register_hosting_provider(Arc::new(Codeberg));
}