Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
wilyle committed Feb 16, 2024
1 parent 1a56c0e commit d0bf143
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mod in_memory_mock_digital_twin_adapter_tests {
impl ServiceDiscoveryAdapterSelector for ServiceDiscoveryAdapterSelectorImpl {
fn register(&mut self, adapter: Box<dyn ServiceDiscoveryAdapter + Send + Sync>) -> Result<(), ServiceDiscoveryAdapterError>;

async fn get_service_uri(&self, id: &String) -> Result<String, ServiceDiscoveryAdapterError>;
async fn get_service_uri<'a>(&self, id: &'a str) -> Result<String, ServiceDiscoveryAdapterError>;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ServiceDiscoveryAdapter for ChariottServiceDiscoveryAdapter {
///
/// # Arguments
/// - `id`: the service identifier
async fn get_service_uri(&self, id: &String) -> Result<String, ServiceDiscoveryAdapterError> {
async fn get_service_uri<'a>(&self, id: &'a str) -> Result<String, ServiceDiscoveryAdapterError> {
let pieces = id.split('/').collect::<Vec<_>>();
if pieces.len() != 3 {
return Err(ServiceDiscoveryAdapterErrorKind::InvalidId.into());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl ServiceDiscoveryAdapter for FileServiceDiscoveryAdapter {
///
/// # Arguments
/// - `id`: the service identifier
async fn get_service_uri(&self, id: &String) -> Result<String, ServiceDiscoveryAdapterError> {
async fn get_service_uri<'a>(&self, id: &'a str) -> Result<String, ServiceDiscoveryAdapterError> {
self.config
.services
.get(id)
Expand Down
2 changes: 1 addition & 1 deletion common/src/service_discovery_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub trait ServiceDiscoveryAdapter {
///
/// # Arguments
/// - `id`: the service identifier
async fn get_service_uri(&self, id: &String) -> Result<String, ServiceDiscoveryAdapterError>;
async fn get_service_uri<'a>(&self, id: &'a str) -> Result<String, ServiceDiscoveryAdapterError>;
}

proc_macros::error! {
Expand Down
2 changes: 1 addition & 1 deletion common/src/service_discovery_adapter_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ pub trait ServiceDiscoveryAdapterSelector {
///
/// # Arguments
/// - `id`: the service identifier
async fn get_service_uri(&self, id: &String) -> Result<String, ServiceDiscoveryAdapterError>;
async fn get_service_uri<'a>(&self, id: &'a str) -> Result<String, ServiceDiscoveryAdapterError>;
}
2 changes: 1 addition & 1 deletion freyja/src/service_discovery_adapter_selector_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ServiceDiscoveryAdapterSelector for ServiceDiscoveryAdapterSelectorImpl {
///
/// # Arguments
/// - `id`: the service identifier
async fn get_service_uri(&self, id: &String) -> Result<String, ServiceDiscoveryAdapterError> {
async fn get_service_uri<'a>(&self, id: &'a str) -> Result<String, ServiceDiscoveryAdapterError> {
for adapter in self.adapters.iter() {
log::debug!(
"Attempting to discover uri for service {id} from adapter {}...",
Expand Down
4 changes: 2 additions & 2 deletions proc_macros/src/freyja_main/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mod freyja_main_parse_tests {
output.service_discovery_adapter_types.len(),
service_discovery_idents.len()
);
for i in 0..service_discovery_idents.len() {
for (i, _) in service_discovery_idents.iter().enumerate() {
assert_eq!(
output.service_discovery_adapter_types[i],
service_discovery_idents[i]
Expand All @@ -142,7 +142,7 @@ mod freyja_main_parse_tests {
factory_idents.len()
);

for i in 0..factory_idents.len() {
for (i, _) in factory_idents.iter().enumerate() {
assert_eq!(output.service_discovery_adapter_types[i], factory_idents[i]);
}
}
Expand Down

0 comments on commit d0bf143

Please sign in to comment.