From 8e81b9edb2b8b0ea8b01c88ef837bacd97daa0dd Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 26 Jul 2020 12:19:07 -0500 Subject: [PATCH] Fix example in readme --- activitystreams-ext/CHANGELOG.md | 1 + activitystreams-ext/README.md | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/activitystreams-ext/CHANGELOG.md b/activitystreams-ext/CHANGELOG.md index 5ec0a9f..c0208ac 100644 --- a/activitystreams-ext/CHANGELOG.md +++ b/activitystreams-ext/CHANGELOG.md @@ -1,4 +1,5 @@ # Unreleased +Fix example in readme # 0.1.0-alpha.2 Fix docs diff --git a/activitystreams-ext/README.md b/activitystreams-ext/README.md index 2ffe130..56f6782 100644 --- a/activitystreams-ext/README.md +++ b/activitystreams-ext/README.md @@ -17,15 +17,15 @@ activitystreams-ext = "0.1.0-alpha.2" For an example, we'll implement a PublicKey extension and demonstrate usage with Ext1 ```rust -use activitystreams_ext::{Ext1, UnparsedExtension}; use activitystreams::{ actor::{ApActor, Person}, context, prelude::*, - primitives::XsdAnyUri, security, unparsed::UnparsedMutExt, + url::Url, }; +use activitystreams_ext::{Ext1, UnparsedExtension}; #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] #[serde(rename_all = "camelCase")] @@ -36,8 +36,8 @@ pub struct PublicKey { #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] #[serde(rename_all = "camelCase")] pub struct PublicKeyInner { - id: XsdAnyUri, - owner: XsdAnyUri, + id: Url, + owner: Url, public_key_pem: String, } @@ -62,11 +62,7 @@ where pub type ExtendedPerson = Ext1, PublicKey>; fn main() -> Result<(), anyhow::Error> { - let actor = ApActor::new( - "http://in.box".parse()?, - "http://out.box".parse()?, - Person::new(), - ); + let actor = ApActor::new("http://in.box".parse()?, Person::new()); let mut person = Ext1::new( actor,