From 6c16315a07bd556da59c181cf7dbfa66ded90b79 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 14 Nov 2024 17:34:15 +0100 Subject: [PATCH] cargo fmt --- src/main.rs | 2 +- src/routes/agreements.rs | 2 +- src/routes/not_found.rs | 2 +- src/routes/portfolio.rs | 21 +++------------------ src/routes/web3.rs | 2 +- 5 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/main.rs b/src/main.rs index 56d2d5b..cf9dab7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,8 +13,8 @@ use crate::routes::{ mod config; mod template; -mod utils; mod routes; +mod utils; #[actix_web::main] async fn main() -> Result<()> { diff --git a/src/routes/agreements.rs b/src/routes/agreements.rs index 7b92b39..3f584a2 100644 --- a/src/routes/agreements.rs +++ b/src/routes/agreements.rs @@ -1,4 +1,4 @@ -use crate::{config::Config, utils::misc::get_url, template::InfosPage}; +use crate::{config::Config, template::InfosPage, utils::misc::get_url}; use actix_web::{get, http::header::ContentType, routes, web, HttpResponse, Responder}; use cached::proc_macro::once; use ramhorns::Content; diff --git a/src/routes/not_found.rs b/src/routes/not_found.rs index 178ef6b..276bf78 100644 --- a/src/routes/not_found.rs +++ b/src/routes/not_found.rs @@ -4,8 +4,8 @@ use ramhorns::Content; use crate::{ config::Config, - utils::misc::{get_url, Html}, template::{InfosPage, NavBar}, + utils::misc::{get_url, Html}, }; pub async fn page(config: web::Data) -> impl Responder { diff --git a/src/routes/portfolio.rs b/src/routes/portfolio.rs index 6e67c05..b4091f3 100644 --- a/src/routes/portfolio.rs +++ b/src/routes/portfolio.rs @@ -36,21 +36,12 @@ fn build_page(config: Config) -> String { let ext = ".md"; // Get about - let about = read_file( - format!("{projects_dir}/about.md"), - MType::Generic, - ); + let about = read_file(format!("{projects_dir}/about.md"), MType::Generic); // Get apps let apps = glob(&format!("{apps_dir}/*{ext}")) .unwrap() - .map(|e| { - read_file( - e.unwrap().to_string_lossy().to_string(), - MType::Portfolio, - ) - .unwrap() - }) + .map(|e| read_file(e.unwrap().to_string_lossy().to_string(), MType::Portfolio).unwrap()) .collect::>(); let appdata = if apps.is_empty() { @@ -62,13 +53,7 @@ fn build_page(config: Config) -> String { // Get archived apps let archived_apps = glob(&format!("{apps_dir}/archive/*{ext}")) .unwrap() - .map(|e| { - read_file( - e.unwrap().to_string_lossy().to_string(), - MType::Portfolio, - ) - .unwrap() - }) + .map(|e| read_file(e.unwrap().to_string_lossy().to_string(), MType::Portfolio).unwrap()) .collect::>(); let archived_appdata = if archived_apps.is_empty() { diff --git a/src/routes/web3.rs b/src/routes/web3.rs index 86a98eb..1c00d6e 100644 --- a/src/routes/web3.rs +++ b/src/routes/web3.rs @@ -3,8 +3,8 @@ use cached::proc_macro::once; use crate::{ config::Config, - utils::misc::{make_kw, Html}, template::InfosPage, + utils::misc::{make_kw, Html}, }; #[get("/web3")]