This commit is contained in:
asonix 2022-12-19 16:10:15 -06:00
parent a65404b4a9
commit 8bf3f2fc17
3 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
[package] [package]
name = "activitystreams" name = "activitystreams"
description = "A set of core types and traits for activitystreams data" 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" license = "GPL-3.0"
authors = ["asonix <asonix@asonix.dog>"] authors = ["asonix <asonix@asonix.dog>"]
repository = "https://git.asonix.dog/asonix/activitystreams" repository = "https://git.asonix.dog/asonix/activitystreams"

View file

@ -263,7 +263,7 @@ pub trait BaseExt: AsBase {
let authority = self let authority = self
.id_unchecked() .id_unchecked()
.and_then(|id| id.authority_components()) .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()) check(iri, authority.host(), authority.port())
} }

View file

@ -23,7 +23,7 @@ pub(crate) fn check<T: AsRef<IriStr>>(
let authority = iri let authority = iri
.as_ref() .as_ref()
.authority_components() .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 { if authority.host() != host || authority.port() != port {
return Err(CheckError(Some(iri.as_ref().to_owned()))); return Err(CheckError(Some(iri.as_ref().to_owned())));