From 33f412210373cbcb92287441fabee7d16af55b17 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sun, 10 May 2020 20:44:15 +0100 Subject: [PATCH] Add verified() for completeness --- crev-wot/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crev-wot/src/lib.rs b/crev-wot/src/lib.rs index 57cbcfa2..fc981f99 100644 --- a/crev-wot/src/lib.rs +++ b/crev-wot/src/lib.rs @@ -1150,6 +1150,14 @@ pub enum UrlOfId<'a> { } impl<'a> UrlOfId<'a> { + /// Only if this URL has been signed by its Id and verified by fetching + pub fn verified(self) -> Option<&'a Url> { + match self { + Self::FromSelfVerified(url) => Some(url), + _ => None, + } + } + /// Only if this URL has been signed by its Id pub fn from_self(self) -> Option<&'a Url> { match self {