Skip to content

Commit 1550c5e

Browse files
committed
Refactor service_types()
Signed-off-by: Patrik Stas <[email protected]>
1 parent 36e7f1c commit 1550c5e

File tree

1 file changed

+3
-3
lines changed
  • did_core/did_doc/src/schema/service

1 file changed

+3
-3
lines changed

did_core/did_doc/src/schema/service/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ impl Service {
5151
&self.service_type
5252
}
5353

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

0 commit comments

Comments
 (0)