Add Link::get_store_id() helper function

This commit is contained in:
Matthias Beyer 2017-04-21 17:53:50 +02:00
parent 6b821f7b28
commit f225aec9da

View file

@ -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 /// Helper wrapper around Link for StoreId
fn without_base(self) -> Link { fn without_base(self) -> Link {
match self { match self {