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())));