|
|
|
@ -4,6 +4,7 @@ use crate::api_core::access_management::{
|
|
|
|
|
SERVICE_TYPE_FILE_REPOSITORIES, SERVICE_TYPE_LOCAL_FILES, SERVICE_TYPE_LOCAL_TAGS,
|
|
|
|
|
SERVICE_TYPE_TAG_REPOSITORIES, SERVICE_TYPE_TRASH,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
use crate::error::Error;
|
|
|
|
|
use crate::Client;
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
@ -140,13 +141,9 @@ impl Services {
|
|
|
|
|
/// Returns a list of all services of the given type
|
|
|
|
|
pub fn get_services(&self, service_type: ServiceType) -> Vec<&Service> {
|
|
|
|
|
if let Some(services) = self.inner.get(&service_type) {
|
|
|
|
|
let mut borrowed_services = Vec::with_capacity(services.len());
|
|
|
|
|
for service in services {
|
|
|
|
|
borrowed_services.push(service)
|
|
|
|
|
}
|
|
|
|
|
borrowed_services
|
|
|
|
|
services.into_iter().collect()
|
|
|
|
|
} else {
|
|
|
|
|
Vec::with_capacity(0)
|
|
|
|
|
Vec::new()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|