Skip to content

Commit

Permalink
Refactor service_types()
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas committed Jan 15, 2024
1 parent 36e7f1c commit 1550c5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions did_core/did_doc/src/schema/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ impl Service {
&self.service_type
}

pub fn service_types(&self) -> Vec<ServiceType> {
pub fn service_types(&self) -> &[ServiceType] {
match &self.service_type {
OneOrList::One(service_type) => vec![service_type.clone()],
OneOrList::List(service_types) => service_types.clone(),
OneOrList::One(service_type) => std::slice::from_ref(service_type),
OneOrList::List(service_types) => service_types.as_slice()
}
}

Expand Down

0 comments on commit 1550c5e

Please sign in to comment.