From 9fc83f8d4fa360a2eb9812880e1db0fba6d4bad8 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 30 Mar 2023 20:20:27 -0700 Subject: deps(windmark): bump 0.2.1 -> 0.2.2 --- src/macros.rs | 4 ++-- src/main.rs | 2 +- src/modules/api/sydney.rs | 4 +++- src/modules/blog/module.rs | 7 +++---- src/modules/random.rs | 5 ++--- src/modules/search.rs | 4 ++-- src/modules/stocks.rs | 4 ++-- src/modules/uptime.rs | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/macros.rs b/src/macros.rs index 7a39dbd..32703e9 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -37,7 +37,7 @@ macro_rules! success { ($body:expr, $context:ident) => {{ $crate::route::cache(&$context, &$body); - windmark::Response::Success( + windmark::Response::success( $crate::macros::Main { body: &$body, hits: &$crate::route::hits_from($context.url.path()), @@ -85,7 +85,7 @@ macro_rules! mount_file { ($router).mount( $at, Box::new(|_| { - windmark::Response::SuccessFileAuto(include_bytes!(concat!( + windmark::Response::binary_success_auto(include_bytes!(concat!( "../../content/meta/", $file ))) diff --git a/src/main.rs b/src/main.rs index 38109cf..793a651 100644 --- a/src/main.rs +++ b/src/main.rs @@ -99,7 +99,7 @@ async fn main() -> Result<(), Box> { router.set_private_key_file(".locus/locus_private.pem"); router.set_certificate_file(".locus/locus_public.pem"); router.set_error_handler(Box::new(|_| { - windmark::Response::NotFound(ERROR_HANDLER_RESPONSE.into()) + windmark::Response::not_found(ERROR_HANDLER_RESPONSE) })); router.set_fix_path(true); diff --git a/src/modules/api/sydney.rs b/src/modules/api/sydney.rs index f24a4f7..1adc07d 100644 --- a/src/modules/api/sydney.rs +++ b/src/modules/api/sydney.rs @@ -52,7 +52,9 @@ pub fn module(router: &mut windmark::Router) { crate::route::cache(&context, &content); - windmark::Response::SuccessWithMime(content, "text/plain".to_string()) + windmark::Response::success(content) + .with_mime("text/plain") + .clone() }), ); } diff --git a/src/modules/blog/module.rs b/src/modules/blog/module.rs index e2ac456..dbdf7ed 100644 --- a/src/modules/blog/module.rs +++ b/src/modules/blog/module.rs @@ -322,10 +322,9 @@ pub fn module(router: &mut windmark::Router) { &format!("/blog/{}.xml", fixed_blog_name), &format!("Really Simple Syndication for the {} blog", name), Box::new(move |_| { - windmark::Response::SuccessWithMime( - xml.to_string(), - "text/rss+xml".to_string(), - ) + windmark::Response::success(xml.to_string()) + .with_mime("text/rss+xml") + .clone() }), ); } diff --git a/src/modules/random.rs b/src/modules/random.rs index 9320ac6..885782c 100644 --- a/src/modules/random.rs +++ b/src/modules/random.rs @@ -24,14 +24,13 @@ pub fn module(router: &mut windmark::Router) { "/random", "Get redirected to a random route", Box::new(|_| { - windmark::Response::TemporaryRedirect( + windmark::Response::temporary_redirect( (*crate::route::ROUTES.lock().unwrap()) .iter() .collect::>() .choose(&mut rand::thread_rng()) .unwrap() - .0 - .to_string(), + .0, ) }), ); diff --git a/src/modules/search.rs b/src/modules/search.rs index 6ad3898..bf0b7bb 100644 --- a/src/modules/search.rs +++ b/src/modules/search.rs @@ -64,8 +64,8 @@ pub(super) fn module(router: &mut windmark::Router) { if let Some(query) = context.url.query_pairs().next() { if query.0 == "action" && query.1 == "go" { - return windmark::Response::Input( - "What would you like to search for?".to_string(), + return windmark::Response::input( + "What would you like to search for?", ); } diff --git a/src/modules/stocks.rs b/src/modules/stocks.rs index bc07f71..832a1ad 100644 --- a/src/modules/stocks.rs +++ b/src/modules/stocks.rs @@ -169,8 +169,8 @@ pub fn module(router: &mut windmark::Router) { if symbol != "Symbol Search" { if let Some(query) = context.url.query_pairs().next() { if query.0 == "action" && query.1 == "go" { - return windmark::Response::Input( - "Which symbol would you like to explore?".to_string(), + return windmark::Response::input( + "Which symbol would you like to explore?", ); } diff --git a/src/modules/uptime.rs b/src/modules/uptime.rs index 6f33433..9a9e1b5 100644 --- a/src/modules/uptime.rs +++ b/src/modules/uptime.rs @@ -48,7 +48,7 @@ pub fn module(router: &mut windmark::Router) { crate::route::cache(&context, &response); - windmark::Response::Success(response) + windmark::Response::success(response) }), ); } -- cgit v1.2.3