Skip to content

Commit

Permalink
Fix dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
drakeerv committed Dec 2, 2024
1 parent bfcb3d1 commit 284e7fb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pasted"
version = "1.2.28"
version = "1.2.29"
edition = "2021"
authors = ["drakeerv <drakeerv@outlook.com>"]
description = "A pastebin frontend written in Rust"
Expand Down
2 changes: 1 addition & 1 deletion src/routes/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use axum::{
body::Body,
extract::State,
http::StatusCode,
response::{IntoResponse, Response},
response::Response,
routing, Json, Router,
};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion src/routes/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async fn post_create(
.add_text("PostForm[is_guest]", "1")
.unwrap()
.finish()
.map_err(|e| render_error(Error::new(
.map_err(|_e| render_error(Error::new(
StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
"Failed to create form".to_string(),
ErrorSource::Internal
Expand Down
12 changes: 7 additions & 5 deletions src/routes/public.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use axum::{
body::Body,
http::StatusCode,
response::{IntoResponse, Response},
response::Response,
routing, Router,
};

Expand All @@ -21,7 +21,7 @@ async fn favicon_png() -> Result<Response<Body>, Response<Body>> {
.header("Content-Type", "image/png")
.header("Cache-Control", "public, max-age=31536000, immutable")
.body(Body::from(include_bytes!("assets/favicon.png").to_vec()))
.map_err(|e| render_error(Error::new(
.map_err(|_e| render_error(Error::new(
StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
"Failed to serve favicon.png".to_string(),
ErrorSource::Internal
Expand All @@ -34,7 +34,7 @@ async fn favicon_ico() -> Result<Response<Body>, Response<Body>> {
.header("Content-Type", "image/x-icon")
.header("Cache-Control", "public, max-age=31536000, immutable")
.body(Body::from(include_bytes!("assets/favicon.ico").to_vec()))
.map_err(|e| render_error(Error::new(
.map_err(|_e| render_error(Error::new(
StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
"Failed to serve favicon.ico".to_string(),
ErrorSource::Internal
Expand All @@ -47,7 +47,7 @@ async fn manifest() -> Result<Response<Body>, Response<Body>> {
.header("Content-Type", "application/json")
.header("Cache-Control", "public, max-age=31536000, immutable")
.body(Body::from(include_bytes!("assets/manifest.json").to_vec()))
.map_err(|e| render_error(Error::new(
.map_err(|_e| render_error(Error::new(
StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
"Failed to serve manifest.json".to_string(),
ErrorSource::Internal
Expand All @@ -60,7 +60,7 @@ async fn robots() -> Result<Response<Body>, Response<Body>> {
.header("Content-Type", "text/plain")
.header("Cache-Control", "public, max-age=31536000, immutable")
.body(Body::from(include_bytes!("assets/robots.txt").to_vec()))
.map_err(|e| render_error(Error::new(
.map_err(|_e| render_error(Error::new(
StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
"Failed to serve robots.txt".to_string(),
ErrorSource::Internal
Expand All @@ -69,6 +69,8 @@ async fn robots() -> Result<Response<Body>, Response<Body>> {

#[cfg(test)]
mod tests {
use axum::response::IntoResponse as _;

use super::*;

#[tokio::test]
Expand Down

0 comments on commit 284e7fb

Please sign in to comment.