Do it lazily -_-

This commit is contained in:
Bat 2018-07-18 16:03:52 +02:00
parent 488bd929c5
commit e3a7eadb78

View File

@ -16,7 +16,7 @@ use plume_models::{
pub trait Inbox {
fn received(&self, conn: &PgConnection, act: serde_json::Value) -> Result<(), Error> {
let actor_id = Id::new(act["actor"].as_str().unwrap_or(act["actor"]["id"].as_str().expect("No actor ID for incoming activity")));
let actor_id = Id::new(act["actor"].as_str().unwrap_or_else(|| act["actor"]["id"].as_str().expect("No actor ID for incoming activity")));
match act["type"].as_str() {
Some(t) => {
match t {