From ccd546759b6e6b829b6baac0343eb3f211be99c5 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 28 Jul 2023 21:01:36 +0200 Subject: [PATCH] feat: don't use shared models for prns The shared models will eventually contain every field in the database, but prns.cc only needs the fields they currently have, so to cut down on memory usage it shouldn't use the shared models. --- prns/src/main.rs | 4 +++- prns/src/models.rs | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 prns/src/models.rs diff --git a/prns/src/main.rs b/prns/src/main.rs index cf8ef55..a8b6c24 100644 --- a/prns/src/main.rs +++ b/prns/src/main.rs @@ -1,8 +1,10 @@ -use pronouns::models::{member::Member, user::User}; +pub mod models; + use rocket::{response::Redirect, Config, State}; use simple_logger; use sqlx::{postgres::PgPoolOptions, Pool, Postgres}; use std::{env, path::PathBuf}; +use crate::models::{User, Member}; #[macro_use] extern crate rocket; diff --git a/prns/src/models.rs b/prns/src/models.rs new file mode 100644 index 0000000..e0bf2d7 --- /dev/null +++ b/prns/src/models.rs @@ -0,0 +1,14 @@ +#[derive(Debug)] +pub struct User { + pub id: String, + pub sid: String, + pub username: String, +} + +#[derive(Debug)] +pub struct Member { + pub id: String, + pub user_id: String, + pub sid: String, + pub name: String, +}