From 399af4004a3bf034573f1d35e838ebe62521fe20 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Thu, 5 Jan 2023 02:20:25 +0900 Subject: [PATCH] Build CustomPerson from source string at once --- plume-models/src/users.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 0314bf0b..200260fe 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -246,20 +246,7 @@ impl User { fn fetch(url: &str) -> Result { let res = get(url, Self::get_sender(), CONFIG.proxy().cloned())?; let text = &res.text()?; - // without this workaround, publicKey is not correctly deserialized - let ap_sign = serde_json::from_str::(text)?; - let person = serde_json::from_str::(text)?; - let json = CustomPerson::new( - ApActor::new( - person - .clone() - .id_unchecked() - .ok_or(Error::MissingApProperty)? - .to_owned(), - person, - ), - ap_sign, - ); // FIXME: Don't clone() + let json = serde_json::from_str::(text)?; Ok(json) }