diff --git a/logos/runtime/ext/src/lib.rs b/logos/runtime/ext/src/lib.rs index 177823b..8701c6c 100644 --- a/logos/runtime/ext/src/lib.rs +++ b/logos/runtime/ext/src/lib.rs @@ -44,7 +44,7 @@ impl Application for LbcExtEnv { type FeedRuntime = ::FeedRuntime; fn external_node_client(source: &ExternalNodeSource) -> Result { - let base_url = Url::parse(&source.endpoint)?; + let base_url = Url::parse(source.endpoint())?; Ok(NodeHttpClient::from_urls(base_url, None)) } diff --git a/testing-framework/core/src/scenario/runtime/providers/external_provider.rs b/testing-framework/core/src/scenario/runtime/providers/external_provider.rs index 343a35c..1a1beb6 100644 --- a/testing-framework/core/src/scenario/runtime/providers/external_provider.rs +++ b/testing-framework/core/src/scenario/runtime/providers/external_provider.rs @@ -71,11 +71,11 @@ impl ExternalProvider for ApplicationExternalProvider { .map(|source| { E::external_node_client(source) .map(|client| ExternalNode { - identity_hint: Some(source.label.clone()), + identity_hint: Some(source.label().to_string()), client, }) .map_err(|build_error| ExternalProviderError::Build { - source_label: source.label.clone(), + source_label: source.label().to_string(), source: build_error, }) }) diff --git a/testing-framework/core/src/scenario/sources/model.rs b/testing-framework/core/src/scenario/sources/model.rs index 903aff1..c107d7c 100644 --- a/testing-framework/core/src/scenario/sources/model.rs +++ b/testing-framework/core/src/scenario/sources/model.rs @@ -49,8 +49,8 @@ impl AttachSource { /// inventory. #[derive(Clone, Debug, Eq, PartialEq)] pub struct ExternalNodeSource { - pub label: String, - pub endpoint: String, + label: String, + endpoint: String, } impl ExternalNodeSource { @@ -58,6 +58,16 @@ impl ExternalNodeSource { pub fn new(label: String, endpoint: String) -> Self { Self { label, endpoint } } + + #[must_use] + pub fn label(&self) -> &str { + &self.label + } + + #[must_use] + pub fn endpoint(&self) -> &str { + &self.endpoint + } } /// Planned readiness strategy for mixed managed/attached/external sources. diff --git a/testing-framework/deployers/local/src/external.rs b/testing-framework/deployers/local/src/external.rs index 713c5be..696d05e 100644 --- a/testing-framework/deployers/local/src/external.rs +++ b/testing-framework/deployers/local/src/external.rs @@ -35,8 +35,8 @@ pub fn build_external_client( } fn resolve_api_socket(source: &ExternalNodeSource) -> Result { - let source_label = source.label.clone(); - let endpoint = source.endpoint.trim(); + let source_label = source.label().to_string(); + let endpoint = source.endpoint().trim(); if endpoint.is_empty() { return Err(ExternalClientBuildError::EmptyEndpoint { label: source_label,