From f225aec9dadf450da09a9ce4bf67eabe0eddd21f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 21 Apr 2017 17:53:50 +0200 Subject: [PATCH] Add Link::get_store_id() helper function --- libimagentrylink/src/internal.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libimagentrylink/src/internal.rs b/libimagentrylink/src/internal.rs index 1ab7c234..1c170265 100644 --- a/libimagentrylink/src/internal.rs +++ b/libimagentrylink/src/internal.rs @@ -67,6 +67,14 @@ impl Link { } } + /// Get the StoreId inside the Link, which is always present + pub fn get_store_id(&self) -> &StoreId { + match self { + &Link::Id { link: ref s } => s, + &Link::Annotated { link: ref s, .. } => s, + } + } + /// Helper wrapper around Link for StoreId fn without_base(self) -> Link { match self {