aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-08-21 21:20:17 -0400
committerXe Iaso <me@xeiaso.net>2023-08-21 21:21:55 -0400
commitf670dafb8a89d8a1294ceab10318454e394c1cec (patch)
treeeda13d7de5a1b3705d224bcba3f053f0ed33f955
parent275327041b4ce5cac6e1adabc813ece54c646cd6 (diff)
downloadxesite-f670dafb8a89d8a1294ceab10318454e394c1cec.tar.xz
xesite-f670dafb8a89d8a1294ceab10318454e394c1cec.zip
clippy auto-fixes
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--src/app/mod.rs2
-rw-r--r--src/bin/fetch_mastodon_post.rs4
-rw-r--r--src/build.rs4
-rw-r--r--src/handlers/streams.rs2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs
index 6753ff0..9648146 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -43,7 +43,7 @@ async fn patrons() -> Result<Option<patreon::Users>> {
}
}
-pub const ICON: &'static str = "https://xeiaso.net/static/img/avatar.png";
+pub const ICON: &str = "https://xeiaso.net/static/img/avatar.png";
pub struct State {
pub cfg: Arc<Config>,
diff --git a/src/bin/fetch_mastodon_post.rs b/src/bin/fetch_mastodon_post.rs
index c7f4275..c4d981c 100644
--- a/src/bin/fetch_mastodon_post.rs
+++ b/src/bin/fetch_mastodon_post.rs
@@ -40,7 +40,7 @@ async fn main() -> Result<()> {
debug!("wrote post to ./data/toots/{post_hash}.json");
- let mut fout = fs::File::create(&format!("./data/toots/{post_hash}.json"))?;
+ let mut fout = fs::File::create(format!("./data/toots/{post_hash}.json"))?;
serde_json::to_writer_pretty(&mut fout, &toot)?;
debug!("fetching {} ...", toot.attributed_to);
@@ -61,7 +61,7 @@ async fn main() -> Result<()> {
let user_hash = xesite::hash_string(user_url);
debug!("wrote post to ./data/users/{user_hash}.json");
- let mut fout = fs::File::create(&format!("./data/users/{user_hash}.json"))?;
+ let mut fout = fs::File::create(format!("./data/users/{user_hash}.json"))?;
serde_json::to_writer_pretty(&mut fout, &user)?;
Ok(())
diff --git a/src/build.rs b/src/build.rs
index d2fb8e2..ec42c41 100644
--- a/src/build.rs
+++ b/src/build.rs
@@ -5,7 +5,7 @@ fn main() -> Result<()> {
Ructe::from_env()?.compile_templates("templates")?;
let output = Command::new("git")
- .args(&["rev-parse", "HEAD"])
+ .args(["rev-parse", "HEAD"])
.output()
.unwrap();
@@ -16,7 +16,7 @@ fn main() -> Result<()> {
println!(
"cargo:rustc-env=GITHUB_SHA={}",
if git_hash.as_str() == "" {
- out.into()
+ out
} else {
git_hash
}
diff --git a/src/handlers/streams.rs b/src/handlers/streams.rs
index 2818944..5cb587e 100644
--- a/src/handlers/streams.rs
+++ b/src/handlers/streams.rs
@@ -66,7 +66,7 @@ pub async fn show(
Extension(state): Extension<Arc<State>>,
Path(args): Path<ShowArgs>,
) -> (StatusCode, Markup) {
- let state = state.clone();
+ let state = state;
let cfg = state.cfg.clone();
let mut found: Option<&VOD> = None;