aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-03-05 05:31:22 -0800
committerFuwn <[email protected]>2024-03-05 05:31:22 -0800
commit093c7ac678628b478f0b8888108ef50988aee2ad (patch)
tree6c73cb3ca0c5e481816bcf85992283c5df2fb8e9 /src/modules
parentfix(response): unused members (diff)
downloadlocus-093c7ac678628b478f0b8888108ef50988aee2ad.tar.xz
locus-093c7ac678628b478f0b8888108ef50988aee2ad.zip
feat(rustc): bump nightly
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/api/sydney.rs2
-rw-r--r--src/modules/blog/module.rs4
-rw-r--r--src/modules/contact.rs2
-rw-r--r--src/modules/cryptocurrency.rs4
-rw-r--r--src/modules/interests.rs2
-rw-r--r--src/modules/remarks.rs3
-rw-r--r--src/modules/router/translate/module.rs2
-rw-r--r--src/modules/stocks.rs9
-rw-r--r--src/modules/web.rs8
9 files changed, 16 insertions, 20 deletions
diff --git a/src/modules/api/sydney.rs b/src/modules/api/sydney.rs
index f2b7e99..0767328 100644
--- a/src/modules/api/sydney.rs
+++ b/src/modules/api/sydney.rs
@@ -42,7 +42,7 @@ pub fn module(router: &mut windmark::router::Router) {
if let Ok(response_content) = response.json::<Vec<Tags>>().await {
let response_content: Vec<Tags> = response_content;
- if let Some(first_tag) = response_content.get(0) {
+ if let Some(first_tag) = response_content.first() {
content = first_tag.name().clone();
}
diff --git a/src/modules/blog/module.rs b/src/modules/blog/module.rs
index 0263c03..6a36429 100644
--- a/src/modules/blog/module.rs
+++ b/src/modules/blog/module.rs
@@ -216,7 +216,7 @@ pub fn module(router: &mut windmark::router::Router) {
if post.is_empty() {
String::new()
} else {
- format!(" ― {}", post)
+ format!(" ― {post}")
}
}
)
@@ -232,7 +232,7 @@ pub fn module(router: &mut windmark::router::Router) {
for (title, contents) in entries {
let header = construct_header(&config, &title)
- .map_or_else(|_| (String::new(), String::new()), |header| header);
+ .map_or_else(|()| (String::new(), String::new()), |header| header);
let fixed_blog_name = fixed_blog_name_clone_2.clone();
let mut real_title = "Unknown";
diff --git a/src/modules/contact.rs b/src/modules/contact.rs
index c4ba49f..4611e5c 100644
--- a/src/modules/contact.rs
+++ b/src/modules/contact.rs
@@ -32,7 +32,7 @@ pub fn module(router: &mut windmark::router::Router) {
format!("## {}\n\n{}", category, {
let mut contacts = contacts
.iter()
- .map(|(tag, href)| format!("=> {} {}", href, tag))
+ .map(|(tag, href)| format!("=> {href} {tag}"))
.collect::<Vec<_>>();
contacts.sort();
diff --git a/src/modules/cryptocurrency.rs b/src/modules/cryptocurrency.rs
index 5ab23ea..755c1fd 100644
--- a/src/modules/cryptocurrency.rs
+++ b/src/modules/cryptocurrency.rs
@@ -67,10 +67,8 @@ pub fn module(router: &mut windmark::router::Router) {
"Relevant information regarding cryptocurrency investing",
|context| {
success(
- &format!(
- "# Cryptocurrency\n\n=> /stocks Stock Market Dashboard\n=> \
+ &"# Cryptocurrency\n\n=> /stocks Stock Market Dashboard\n=> \
/cryptocurrency/referrals Referrals",
- ),
&context,
)
},
diff --git a/src/modules/interests.rs b/src/modules/interests.rs
index 4c82fc3..72bfffd 100644
--- a/src/modules/interests.rs
+++ b/src/modules/interests.rs
@@ -32,7 +32,7 @@ pub fn module(router: &mut windmark::router::Router) {
format!("## {}\n\n{}", category, {
let mut contacts = contacts
.iter()
- .map(|(tag, href)| format!("=> {} {}", href, tag))
+ .map(|(tag, href)| format!("=> {href} {tag}"))
.collect::<Vec<_>>();
contacts.sort();
diff --git a/src/modules/remarks.rs b/src/modules/remarks.rs
index 35b3295..312fc27 100644
--- a/src/modules/remarks.rs
+++ b/src/modules/remarks.rs
@@ -26,6 +26,7 @@ static REMARKS: LazyLock<Vec<Remark>> = LazyLock::new(|| {
#[derive(Serialize, Deserialize)]
struct Remark {
+ #[allow(clippy::struct_field_names)]
remark: String,
created: String,
edited: Option<String>,
@@ -50,7 +51,7 @@ pub fn module(router: &mut windmark::router::Router) {
r.remark,
r.created,
r.edited.as_ref().map_or_else(String::new, |edited| {
- format!(" Edited {}", edited)
+ format!(" Edited {edited}")
})
)
})
diff --git a/src/modules/router/translate/module.rs b/src/modules/router/translate/module.rs
index 78ab533..aa46956 100644
--- a/src/modules/router/translate/module.rs
+++ b/src/modules/router/translate/module.rs
@@ -45,7 +45,7 @@ where
if let Some(germ::ast::Node::Link {
to,
text,
- }) = germ::ast::Ast::from_string(line).inner().get(0)
+ }) = germ::ast::Ast::from_string(line).inner().first()
{
saved_lines.insert(
i,
diff --git a/src/modules/stocks.rs b/src/modules/stocks.rs
index 07c6d84..23a0550 100644
--- a/src/modules/stocks.rs
+++ b/src/modules/stocks.rs
@@ -97,9 +97,8 @@ async fn symbol_to_string(symbol: &str) -> String {
quote.as_ref().map_or_else(
|| {
format!(
- "An API error has occurred while looking up the {} symbol... Take \
+ "An API error has occurred while looking up the {symbol} symbol... Take \
this up with Finnhub.",
- symbol
)
},
|quote| quote.try_to_string().unwrap(),
@@ -164,10 +163,9 @@ pub fn module(router: &mut windmark::router::Router) {
}
let mut response = format!(
- "# {}\n\n=> /stocks Dashboard\n=> /cryptocurrency Cryptocurrency \
+ "# {symbol}\n\n=> /stocks Dashboard\n=> /cryptocurrency Cryptocurrency \
Dashboard\n=> /stocks/telegram Telegram Groups\n=> /stocks/search \
Search",
- symbol
);
if symbol != "Symbol Search" {
@@ -193,8 +191,7 @@ pub fn module(router: &mut windmark::router::Router) {
success(
&format!(
- "{}\n\n## Credits\n\nFinancial data provided by\n\n=> https://finnhub.io/ Finnhub",
- response
+ "{response}\n\n## Credits\n\nFinancial data provided by\n\n=> https://finnhub.io/ Finnhub",
),
&context
)
diff --git a/src/modules/web.rs b/src/modules/web.rs
index 7551b2c..02354cd 100644
--- a/src/modules/web.rs
+++ b/src/modules/web.rs
@@ -35,13 +35,13 @@ pub fn module(router: &mut windmark::router::Router) {
"World Wide Web to Gemini Gateway",
|context| {
success(
- &r#"# World Wide Web to Gemini Gateway
+ &r"# World Wide Web to Gemini Gateway
To use this gateway, simply append the address of your target resource to the end of the current route, minus the protocol.
To visit the web version of this exact page, <https://fuwn.me/web>, you would visit <gemini://fuwn.me/web/fuwn.me/web>.
-=> /web/fuwn.me/web Try it!"#,
+=> /web/fuwn.me/web Try it!",
&context,
)
},
@@ -96,7 +96,7 @@ To visit the web version of this exact page, <https://fuwn.me/web>, you would vi
while let Some(element) = nodes.next() {
let mut text = String::new();
- element.as_tag().map_or((), |tag| {
+ let () = element.as_tag().map_or((), |tag| {
match tag.name().as_utf8_str().to_string().as_str() {
"p" => {
contents.push(format!(
@@ -162,7 +162,7 @@ To visit the web version of this exact page, <https://fuwn.me/web>, you would vi
println!(
"{}: {}",
- tag.name().as_utf8_str().to_string(),
+ tag.name().as_utf8_str(),
tag.inner_text(parser)
);