From 4cb98a67069d728ca4728e483efe63f63cdde2ea Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 14 May 2020 11:23:38 -0500 Subject: [PATCH] Add builder --- Cargo.toml | 4 + examples/basic.rs | 24 ++--- src/activity.rs | 150 +++++++++++++++++++++++++--- src/actor.rs | 18 +++- src/collection.rs | 106 ++++++++++++-------- src/object.rs | 242 +++++++++++++++++++++++++++++++++++++++++++--- src/primitives.rs | 14 ++- 7 files changed, 476 insertions(+), 82 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d62168e..79d3d6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,10 @@ edition = "2018" activitystreams = { version = "0.6.1", default-features = false, features = ["kinds","primitives"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" +typed-builder = "0.5.1" [dev-dependencies] anyhow = "1.0" + +[patch.crates-io] +typed-builder = { git = "https://git.asonix.dog/asonix/typed-builder" } diff --git a/examples/basic.rs b/examples/basic.rs index 3d28669..c7e3d5a 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -5,22 +5,16 @@ use activitystreams_new::{ }; fn main() -> Result<(), Box> { - let mut v: ApObject