diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-20 21:45:18 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-20 22:57:39 +0200 |
commit | 9ddb4d7786509bf5995bd5e254c611a05ea50eba (patch) | |
tree | de606bbb04f56e201eebdbf1a075595149441998 /server/registry/src/list.rs | |
parent | f2836d359942a6b42b1db9d1fd7624499798d925 (diff) | |
download | hurrycurry-9ddb4d7786509bf5995bd5e254c611a05ea50eba.tar hurrycurry-9ddb4d7786509bf5995bd5e254c611a05ea50eba.tar.bz2 hurrycurry-9ddb4d7786509bf5995bd5e254c611a05ea50eba.tar.zst |
reg: move structs to protocol crate
Diffstat (limited to 'server/registry/src/list.rs')
-rw-r--r-- | server/registry/src/list.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/registry/src/list.rs b/server/registry/src/list.rs index eb1ddfbf..67f2ec2a 100644 --- a/server/registry/src/list.rs +++ b/server/registry/src/list.rs @@ -1,5 +1,6 @@ -use crate::{PublicEntry, Registry}; +use crate::Registry; use anyhow::Result; +use hurrycurry_protocol::registry::Entry; use rocket::{ get, http::MediaType, @@ -22,15 +23,15 @@ pub(super) async fn r_list( } } -pub(super) fn generate_json_list(entries: &[PublicEntry]) -> Result<Arc<str>> { +pub(super) fn generate_json_list(entries: &[Entry]) -> Result<Arc<str>> { Ok(serde_json::to_string(&entries)?.into()) } -pub(super) fn generate_html_list(entries: &[PublicEntry]) -> Result<Arc<str>> { +pub(super) fn generate_html_list(entries: &[Entry]) -> Result<Arc<str>> { Ok(ListPage { entries }.to_string().into()) } markup::define!( - ListPage<'a>(entries: &'a [PublicEntry]) { + ListPage<'a>(entries: &'a [Entry]) { @markup::doctype() html { head { |