~kmaasrud/pimalaya-webfinger

7b14879d701ebf79f397a4d4829bd00b0a7b625e — Knut Magnus Aasrud 8 months ago dfa97cb main
style: simplify rel matching
1 files changed, 2 insertions(+), 8 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +2 -8
@@ 124,18 124,12 @@ impl Link {

    /// Returns `true` if the link's `rel` is a URI.
    pub fn rel_is_uri(&self) -> bool {
        match &self.rel {
            RelOrUri::Rel(_) => false,
            RelOrUri::Uri(_) => true,
        }
        matches!(self.rel, RelOrUri::Uri(_))
    }

    /// Returns `true` if the link's `rel` is a registered relation type.
    pub fn rel_is_registered(&self) -> bool {
        match &self.rel {
            RelOrUri::Rel(_) => true,
            RelOrUri::Uri(_) => false,
        }
        matches!(self.rel, RelOrUri::Rel(_))
    }
}