From df7e9d068b524f99babef9b945d61af6a7004897 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 13 Oct 2023 16:20:49 +0200 Subject: [PATCH] remove useless pub keywords --- src/misc/markdown.rs | 2 +- src/routes/agreements.rs | 8 ++++---- src/routes/api_v1.rs | 2 +- src/routes/blog.rs | 8 ++++---- src/routes/contact.rs | 4 ++-- src/routes/contrib.rs | 4 ++-- src/routes/cours.rs | 2 +- src/routes/cv.rs | 2 +- src/routes/gaming.rs | 2 +- src/routes/index.rs | 4 ++-- src/routes/memorial.rs | 2 +- src/routes/not_found.rs | 2 +- src/routes/portfolio.rs | 4 ++-- src/routes/setup.rs | 2 +- src/routes/web3.rs | 4 ++-- 15 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/misc/markdown.rs b/src/misc/markdown.rs index a58b242..932875b 100644 --- a/src/misc/markdown.rs +++ b/src/misc/markdown.rs @@ -86,7 +86,7 @@ pub fn get_options() -> ComrakOptions { } /// Transform markdown string to File structure -pub fn read(raw_text: &str) -> File { +fn read(raw_text: &str) -> File { let arena = Arena::new(); let options = get_options(); diff --git a/src/routes/agreements.rs b/src/routes/agreements.rs index 91a87a7..1aaca6d 100644 --- a/src/routes/agreements.rs +++ b/src/routes/agreements.rs @@ -6,7 +6,7 @@ use ramhorns::Content; #[routes] #[get("/.well-known/security.txt")] #[get("/security.txt")] -pub async fn security(req: HttpRequest, config: web::Data) -> impl Responder { +async fn security(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_securitytxt( config.get_ref().to_owned(), get_url(req.connection_info()), @@ -34,7 +34,7 @@ fn build_securitytxt(config: Config, url: String) -> String { } #[get("/humans.txt")] -pub async fn humans(config: web::Data) -> impl Responder { +async fn humans(config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_humanstxt(config.get_ref().to_owned())) } @@ -59,7 +59,7 @@ fn build_humanstxt(config: Config) -> String { } #[get("/robots.txt")] -pub async fn robots() -> impl Responder { +async fn robots() -> impl Responder { HttpResponse::Ok().body(build_robotstxt()) } @@ -69,7 +69,7 @@ fn build_robotstxt() -> String { } #[get("/sitemap.xml")] -pub async fn sitemap() -> impl Responder { +async fn sitemap() -> impl Responder { // TODO actix_web::web::Redirect::to("/") } diff --git a/src/routes/api_v1.rs b/src/routes/api_v1.rs index e56c0ef..5068f02 100644 --- a/src/routes/api_v1.rs +++ b/src/routes/api_v1.rs @@ -7,7 +7,7 @@ struct Info { } #[get("/love")] -pub async fn love() -> impl Responder { +async fn love() -> impl Responder { HttpResponse::Ok().json(Info { unix_epoch: 1605576600, }) diff --git a/src/routes/blog.rs b/src/routes/blog.rs index b29f12e..779f90b 100644 --- a/src/routes/blog.rs +++ b/src/routes/blog.rs @@ -27,7 +27,7 @@ use crate::{ const MIME_TYPE_RSS: &str = "application/rss+xml"; #[get("/blog")] -pub async fn index(req: HttpRequest, config: web::Data) -> impl Responder { +async fn index(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_index( config.get_ref().to_owned(), get_url(req.connection_info()), @@ -41,7 +41,7 @@ struct BlogIndexTemplate { } #[once(time = 120)] -pub fn build_index(config: Config, url: String) -> String { +fn build_index(config: Config, url: String) -> String { let mut posts = get_posts("data/blog"); // Sort from newest to oldest @@ -177,7 +177,7 @@ struct BlogPostTemplate { } #[get("/blog/p/{id}")] -pub async fn page( +async fn page( req: HttpRequest, path: web::Path<(String,)>, config: web::Data, @@ -248,7 +248,7 @@ fn get_post( } #[get("/blog/rss")] -pub async fn rss(req: HttpRequest, config: web::Data) -> impl Responder { +async fn rss(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok() .append_header(("content-type", MIME_TYPE_RSS)) .body(build_rss( diff --git a/src/routes/contact.rs b/src/routes/contact.rs index cb02464..0636a1d 100644 --- a/src/routes/contact.rs +++ b/src/routes/contact.rs @@ -9,7 +9,7 @@ use crate::{ }; #[get("/contact")] -pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder { +async fn page(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_page( config.get_ref().to_owned(), get_url(req.connection_info()), @@ -22,7 +22,7 @@ struct NetworksTemplate { } #[once(time = 60)] -pub fn build_page(config: Config, url: String) -> String { +fn build_page(config: Config, url: String) -> String { config.tmpl.render( "contact.html", NetworksTemplate { diff --git a/src/routes/contrib.rs b/src/routes/contrib.rs index 9bc7b1c..4d134fc 100644 --- a/src/routes/contrib.rs +++ b/src/routes/contrib.rs @@ -13,7 +13,7 @@ use cached::proc_macro::once; use ramhorns::Content; #[get("/contrib")] -pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder { +async fn page(req: HttpRequest, config: web::Data) -> impl Responder { let url = get_url(req.connection_info()); HttpResponse::Ok().body(build_page(config.get_ref().to_owned(), url).await) } @@ -46,7 +46,7 @@ struct Pull { } #[once(time = 120)] -pub async fn build_page(config: Config, url: String) -> String { +async fn build_page(config: Config, url: String) -> String { let navbar = NavBar { contrib: true, ..NavBar::default() diff --git a/src/routes/cours.rs b/src/routes/cours.rs index f43ea62..b86662c 100644 --- a/src/routes/cours.rs +++ b/src/routes/cours.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/cours")] -pub async fn page() -> impl Responder { +async fn page() -> impl Responder { // TODO actix_web::web::Redirect::to("/") } diff --git a/src/routes/cv.rs b/src/routes/cv.rs index c9e4cdd..de687ca 100644 --- a/src/routes/cv.rs +++ b/src/routes/cv.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/cv")] -pub async fn page() -> impl Responder { +async fn page() -> impl Responder { // TODO actix_web::web::Redirect::to("/") } diff --git a/src/routes/gaming.rs b/src/routes/gaming.rs index 5885bcc..c8ab433 100644 --- a/src/routes/gaming.rs +++ b/src/routes/gaming.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/gaming")] -pub async fn page() -> impl Responder { +async fn page() -> impl Responder { // TODO actix_web::web::Redirect::to("/") } diff --git a/src/routes/index.rs b/src/routes/index.rs index fe13f4b..c3f3dce 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -9,7 +9,7 @@ use crate::{ }; #[get("/")] -pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder { +async fn page(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_page( config.get_ref().to_owned(), get_url(req.connection_info()), @@ -23,7 +23,7 @@ struct IndexTemplate { } #[once(time = 60)] -pub fn build_page(config: Config, url: String) -> String { +fn build_page(config: Config, url: String) -> String { config.tmpl.render( "index.html", IndexTemplate { diff --git a/src/routes/memorial.rs b/src/routes/memorial.rs index 2ade9da..595f411 100644 --- a/src/routes/memorial.rs +++ b/src/routes/memorial.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/memorial")] -pub async fn page() -> impl Responder { +async fn page() -> impl Responder { // Memorial? J'espere ne jamais faire cette page lol actix_web::web::Redirect::to("/") } diff --git a/src/routes/not_found.rs b/src/routes/not_found.rs index 21650e7..014c0cf 100644 --- a/src/routes/not_found.rs +++ b/src/routes/not_found.rs @@ -17,7 +17,7 @@ struct NotFoundTemplate { } #[once(time = 60)] -pub fn build_page(config: Config) -> String { +fn build_page(config: Config) -> String { config.tmpl.render( "404.html", NotFoundTemplate { diff --git a/src/routes/portfolio.rs b/src/routes/portfolio.rs index fb1f0f6..b27416b 100644 --- a/src/routes/portfolio.rs +++ b/src/routes/portfolio.rs @@ -13,7 +13,7 @@ use crate::{ }; #[get("/portfolio")] -pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder { +async fn page(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_page( config.get_ref().to_owned(), get_url(req.connection_info()), @@ -33,7 +33,7 @@ struct PortfolioTemplate<'a> { } #[once(time = 60)] -pub fn build_page(config: Config, url: String) -> String { +fn build_page(config: Config, url: String) -> String { let projects_dir = "data/projects"; let ext = ".md"; diff --git a/src/routes/setup.rs b/src/routes/setup.rs index 4a8d1f2..dc6bf2a 100644 --- a/src/routes/setup.rs +++ b/src/routes/setup.rs @@ -1,7 +1,7 @@ use actix_web::{get, Responder}; #[get("/setup")] -pub async fn page() -> impl Responder { +async fn page() -> impl Responder { // Explication de l'histoire de par exemple wiki/cat et le follow up // avec les futures video youtube probablement un shortcut // vers un billet de blog diff --git a/src/routes/web3.rs b/src/routes/web3.rs index 93e2c9e..0c8ccc8 100644 --- a/src/routes/web3.rs +++ b/src/routes/web3.rs @@ -4,7 +4,7 @@ use cached::proc_macro::once; use crate::{config::Config, misc::utils::get_url, template::Infos}; #[get("/web3")] -pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder { +async fn page(req: HttpRequest, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_page( config.get_ref().to_owned(), get_url(req.connection_info()), @@ -12,7 +12,7 @@ pub async fn page(req: HttpRequest, config: web::Data) -> impl Responder } #[once(time = 60)] -pub fn build_page(config: Config, url: String) -> String { +fn build_page(config: Config, url: String) -> String { config.tmpl.render( "web3.html", (),