Skip to content

Commit

Permalink
Add verified() for completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed May 10, 2020
1 parent aa2e1f2 commit 33f4122
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crev-wot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 33f4122

Please sign in to comment.