Skip to content

Commit

Permalink
dev: fix clippy warnings for: src/routes/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
da2ce7 committed May 10, 2023
1 parent fd75fd4 commit 7277e4e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub async fn run(configuration: Configuration) -> Running {
.wrap(Cors::permissive())
.app_data(web::Data::new(app_data.clone()))
.wrap(middleware::Logger::default())
.configure(routes::init_routes)
.configure(routes::init)
})
.bind((ip, net_port))
.expect("can't bind server to socket address");
Expand Down
2 changes: 1 addition & 1 deletion src/routes/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use actix_web::{web, HttpResponse, Responder};

use crate::errors::ServiceResult;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/about")
.service(web::resource("").route(web::get().to(get)))
Expand Down
2 changes: 1 addition & 1 deletion src/routes/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::common::WebAppData;
use crate::errors::{ServiceError, ServiceResult};
use crate::models::response::OkResponse;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/category").service(
web::resource("")
Expand Down
16 changes: 8 additions & 8 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ pub mod settings;
pub mod torrent;
pub mod user;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
user::init_routes(cfg);
torrent::init_routes(cfg);
category::init_routes(cfg);
settings::init_routes(cfg);
about::init_routes(cfg);
proxy::init_routes(cfg);
root::init_routes(cfg);
pub fn init(cfg: &mut web::ServiceConfig) {
user::init(cfg);
torrent::init(cfg);
category::init(cfg);
settings::init(cfg);
about::init(cfg);
proxy::init(cfg);
root::init(cfg);
}
2 changes: 1 addition & 1 deletion src/routes/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ERROR_IMAGE_TOO_BIG_TEXT: &str = "Image is too big.";
const ERROR_IMAGE_USER_QUOTA_MET_TEXT: &str = "Image proxy quota met.";
const ERROR_IMAGE_UNAUTHENTICATED_TEXT: &str = "Sign in to see image.";

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(web::scope("/proxy").service(web::resource("/image/{url}").route(web::get().to(get_proxy_image))));

load_error_images();
Expand Down
2 changes: 1 addition & 1 deletion src/routes/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ use actix_web::web;

use crate::routes::about;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(web::scope("/").service(web::resource("").route(web::get().to(about::get))));
}
2 changes: 1 addition & 1 deletion src/routes/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::config;
use crate::errors::{ServiceError, ServiceResult};
use crate::models::response::OkResponse;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/settings")
.service(
Expand Down
2 changes: 1 addition & 1 deletion src/routes/torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::models::torrent::TorrentRequest;
use crate::utils::parse_torrent;
use crate::AsCSV;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/torrent")
.service(web::resource("/upload").route(web::post().to(upload_torrent)))
Expand Down
2 changes: 1 addition & 1 deletion src/routes/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::models::user::UserAuthentication;
use crate::utils::clock::current_time;
use crate::utils::regex::validate_email_address;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/user")
.service(web::resource("/register").route(web::post().to(register)))
Expand Down

0 comments on commit 7277e4e

Please sign in to comment.