diff --git a/gix/src/remote/mod.rs b/gix/src/remote/mod.rs index 38b1ccf27ad..a4167ca8588 100644 --- a/gix/src/remote/mod.rs +++ b/gix/src/remote/mod.rs @@ -1,6 +1,6 @@ -use std::borrow::Cow; - use crate::bstr::BStr; +use std::borrow::Cow; +use std::collections::BTreeSet; /// The direction of an operation carried out (or to be carried out) through a remote. #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] @@ -31,6 +31,9 @@ pub enum Name<'repo> { Url(Cow<'repo, BStr>), } +/// A type-definition for a sorted list of unvalidated remote names - they have been read straight from the configuration. +pub type Names<'a> = BTreeSet>; + /// #[allow(clippy::empty_docs)] pub mod name; diff --git a/gix/src/repository/config/remote.rs b/gix/src/repository/config/remote.rs index 3cab17e194b..0b7f69c7ffa 100644 --- a/gix/src/repository/config/remote.rs +++ b/gix/src/repository/config/remote.rs @@ -1,5 +1,5 @@ use crate::bstr::BStr; -use std::{borrow::Cow, collections::BTreeSet}; +use std::borrow::Cow; use crate::config::tree::{Remote, Section}; use crate::remote; @@ -8,7 +8,7 @@ use crate::remote; impl crate::Repository { /// Returns a sorted list unique of symbolic names of remotes that /// we deem [trustworthy][crate::open::Options::filter_config_section()]. - pub fn remote_names(&self) -> BTreeSet> { + pub fn remote_names(&self) -> remote::Names<'_> { self.config .resolved .sections_by_name(Remote.name())