From 8bf3f2fc177a5b2b7beb9ce22a2923165a5f9fbd Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 19 Dec 2022 16:10:15 -0600 Subject: [PATCH] Clippy --- Cargo.toml | 2 +- src/base.rs | 2 +- src/checked.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 307a3ca..71c61b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "activitystreams" description = "A set of core types and traits for activitystreams data" -version = "0.7.0-alpha.23" +version = "0.7.0-alpha.24" license = "GPL-3.0" authors = ["asonix "] repository = "https://git.asonix.dog/asonix/activitystreams" diff --git a/src/base.rs b/src/base.rs index 5d97514..f373ab5 100644 --- a/src/base.rs +++ b/src/base.rs @@ -263,7 +263,7 @@ pub trait BaseExt: AsBase { let authority = self .id_unchecked() .and_then(|id| id.authority_components()) - .ok_or(CheckError(Some(iri.as_ref().to_owned())))?; + .ok_or_else(|| CheckError(Some(iri.as_ref().to_owned())))?; check(iri, authority.host(), authority.port()) } diff --git a/src/checked.rs b/src/checked.rs index 4cf4a99..0e954f4 100644 --- a/src/checked.rs +++ b/src/checked.rs @@ -23,7 +23,7 @@ pub(crate) fn check>( let authority = iri .as_ref() .authority_components() - .ok_or(CheckError(Some(iri.as_ref().to_owned())))?; + .ok_or_else(|| CheckError(Some(iri.as_ref().to_owned())))?; if authority.host() != host || authority.port() != port { return Err(CheckError(Some(iri.as_ref().to_owned())));