aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-03-30 20:20:27 -0700
committerFuwn <[email protected]>2023-03-30 20:20:27 -0700
commit9fc83f8d4fa360a2eb9812880e1db0fba6d4bad8 (patch)
treea9f566fb606de56334f4be9390d48ad8912bd5e3 /src/modules
parentfeat(translation): add translation header (diff)
downloadlocus-9fc83f8d4fa360a2eb9812880e1db0fba6d4bad8.tar.xz
locus-9fc83f8d4fa360a2eb9812880e1db0fba6d4bad8.zip
deps(windmark): bump 0.2.1 -> 0.2.2
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/api/sydney.rs4
-rw-r--r--src/modules/blog/module.rs7
-rw-r--r--src/modules/random.rs5
-rw-r--r--src/modules/search.rs4
-rw-r--r--src/modules/stocks.rs4
-rw-r--r--src/modules/uptime.rs2
6 files changed, 13 insertions, 13 deletions
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::<Vec<_>>()
.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)
}),
);
}