From e859d8f7e8ab0d5852403c8aecba8310c9e52189 Mon Sep 17 00:00:00 2001 From: Robert Kwolek Date: Mon, 16 Sep 2024 11:58:27 +0200 Subject: [PATCH] fix: service_count var name clarified --- affinidi-did-resolver-methods/did-peer/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/affinidi-did-resolver-methods/did-peer/src/lib.rs b/affinidi-did-resolver-methods/did-peer/src/lib.rs index 05deb70..0adb53b 100644 --- a/affinidi-did-resolver-methods/did-peer/src/lib.rs +++ b/affinidi-did-resolver-methods/did-peer/src/lib.rs @@ -296,7 +296,7 @@ impl DIDMethodResolver for DIDPeer { // did:peer:2.(process from here) let parts: Vec<&str> = method_specific_id[2..].split('.').collect(); let mut key_count: u32 = 1; - let mut service_count: u32 = 0; + let mut service_idx: u32 = 0; for part in parts { let ch = part.chars().next(); @@ -455,18 +455,18 @@ impl DIDMethodResolver for DIDPeer { }; let mut service: Service = service.into(); - if service_count > 0 { + if service_idx > 0 { // TODO: Should be #service-1, #service-2, etc // SSI Crate expects a URI for the service ID service.id = UriBuf::new( - ["did:peer:#service-", &service_count.to_string()] + ["did:peer:#service-", &service_idx.to_string()] .concat() .into(), ) .unwrap(); } services.push(service); - service_count += 1; + service_idx += 1; } other => { return Err(Error::RepresentationNotSupported(format!(