remove empty structs

This commit is contained in:
Mylloon 2023-04-21 19:47:41 +02:00
parent 22b68f549e
commit 2ca24f020e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 4 additions and 22 deletions

View file

@ -1,6 +1,5 @@
use actix_web::{get, web, HttpResponse, Responder}; use actix_web::{get, web, HttpResponse, Responder};
use cached::proc_macro::once; use cached::proc_macro::once;
use ramhorns::Content;
use crate::{config::Config, template::Infos}; use crate::{config::Config, template::Infos};
@ -9,14 +8,11 @@ pub async fn page(config: web::Data<Config>) -> impl Responder {
HttpResponse::Ok().body(build_page(config.get_ref().clone())) HttpResponse::Ok().body(build_page(config.get_ref().clone()))
} }
#[derive(Content)]
struct IndexTemplate {}
#[once(time = 60)] #[once(time = 60)]
pub fn build_page(config: Config) -> String { pub fn build_page(config: Config) -> String {
config.tmpl.render( config.tmpl.render(
"index.html", "index.html",
IndexTemplate {}, (),
Infos { Infos {
page_title: Some("Mylloon".to_owned()), page_title: Some("Mylloon".to_owned()),
page_desc: Some("Page principale".to_owned()), page_desc: Some("Page principale".to_owned()),

View file

@ -1,6 +1,5 @@
use actix_web::{get, web, HttpResponse, Responder}; use actix_web::{get, web, HttpResponse, Responder};
use cached::proc_macro::once; use cached::proc_macro::once;
use ramhorns::Content;
use crate::{config::Config, template::Infos}; use crate::{config::Config, template::Infos};
@ -9,14 +8,11 @@ pub async fn page(config: web::Data<Config>) -> impl Responder {
HttpResponse::Ok().body(build_page(config.get_ref().clone())) HttpResponse::Ok().body(build_page(config.get_ref().clone()))
} }
#[derive(Content)]
struct NetworksTemplate {}
#[once(time = 60)] #[once(time = 60)]
pub fn build_page(config: Config) -> String { pub fn build_page(config: Config) -> String {
config.tmpl.render( config.tmpl.render(
"networks.html", "networks.html",
NetworksTemplate {}, (),
Infos { Infos {
page_title: Some("Mes réseaux".to_owned()), page_title: Some("Mes réseaux".to_owned()),
page_desc: Some("Réseaux d'Anri".to_owned()), page_desc: Some("Réseaux d'Anri".to_owned()),

View file

@ -1,6 +1,5 @@
use actix_web::{web, HttpResponse, Responder}; use actix_web::{web, HttpResponse, Responder};
use cached::proc_macro::once; use cached::proc_macro::once;
use ramhorns::Content;
use crate::{config::Config, template::Infos}; use crate::{config::Config, template::Infos};
@ -8,12 +7,7 @@ pub async fn page(config: web::Data<Config>) -> impl Responder {
HttpResponse::NotFound().body(build_page(config.get_ref().clone())) HttpResponse::NotFound().body(build_page(config.get_ref().clone()))
} }
#[derive(Content)]
struct Error404Template {}
#[once(time = 60)] #[once(time = 60)]
pub fn build_page(config: Config) -> String { pub fn build_page(config: Config) -> String {
config config.tmpl.render("404.html", (), Infos::default())
.tmpl
.render("404.html", Error404Template {}, Infos::default())
} }

View file

@ -1,6 +1,5 @@
use actix_web::{get, web, HttpResponse, Responder}; use actix_web::{get, web, HttpResponse, Responder};
use cached::proc_macro::once; use cached::proc_macro::once;
use ramhorns::Content;
use crate::{config::Config, template::Infos}; use crate::{config::Config, template::Infos};
@ -9,14 +8,11 @@ pub async fn page(config: web::Data<Config>) -> impl Responder {
HttpResponse::Ok().body(build_page(config.get_ref().clone())) HttpResponse::Ok().body(build_page(config.get_ref().clone()))
} }
#[derive(Content)]
struct Web3Template {}
#[once(time = 60)] #[once(time = 60)]
pub fn build_page(config: Config) -> String { pub fn build_page(config: Config) -> String {
config.tmpl.render( config.tmpl.render(
"web3.html", "web3.html",
Web3Template {}, (),
Infos { Infos {
page_title: Some("Mylloon".to_owned()), page_title: Some("Mylloon".to_owned()),
page_desc: Some("Coin reculé de l'internet".to_owned()), page_desc: Some("Coin reculé de l'internet".to_owned()),