From 5de807b3d9500385bfbd10eb769da7d4fd339c65 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 12 Apr 2024 21:42:06 +0200 Subject: [PATCH] fix: don't clear audiences still quite jank way to do it but at least should work again? --- src/model/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/model/mod.rs b/src/model/mod.rs index aee73ec9..279b16d8 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -29,15 +29,15 @@ impl From for axum::http::StatusCode { #[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize, sea_orm::FromJsonQueryResult)] pub struct Audience(pub Vec); -use apb::{Link, Node}; -impl From> for Audience { - fn from(value: Node) -> Self { +impl From> for Audience { + fn from(value: apb::Node) -> Self { + use apb::{Base, Link}; Audience( match value { - Node::Empty => vec![], - Node::Link(l) => vec![l.href().to_string()], - Node::Object(o) => if let Some(id) = o.id() { vec![id.to_string()] } else { vec![] }, - Node::Array(arr) => arr.into_iter().filter_map(|l| Some(l.id()?.to_string())).collect(), + apb::Node::Empty => vec![], + apb::Node::Link(l) => vec![l.href().to_string()], + apb::Node::Object(o) => if let Some(id) = o.id() { vec![id.to_string()] } else { vec![] }, + apb::Node::Array(arr) => arr.into_iter().map(|l| l.href().to_string()).collect(), } ) }