Skip to content

Commit 7277e4e

Browse files
committed
dev: fix clippy warnings for: src/routes/mod.rs
1 parent fd75fd4 commit 7277e4e

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub async fn run(configuration: Configuration) -> Running {
9191
.wrap(Cors::permissive())
9292
.app_data(web::Data::new(app_data.clone()))
9393
.wrap(middleware::Logger::default())
94-
.configure(routes::init_routes)
94+
.configure(routes::init)
9595
})
9696
.bind((ip, net_port))
9797
.expect("can't bind server to socket address");

src/routes/about.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use actix_web::{web, HttpResponse, Responder};
33

44
use crate::errors::ServiceResult;
55

6-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
6+
pub fn init(cfg: &mut web::ServiceConfig) {
77
cfg.service(
88
web::scope("/about")
99
.service(web::resource("").route(web::get().to(get)))

src/routes/category.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::common::WebAppData;
55
use crate::errors::{ServiceError, ServiceResult};
66
use crate::models::response::OkResponse;
77

8-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
8+
pub fn init(cfg: &mut web::ServiceConfig) {
99
cfg.service(
1010
web::scope("/category").service(
1111
web::resource("")

src/routes/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ pub mod settings;
88
pub mod torrent;
99
pub mod user;
1010

11-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
12-
user::init_routes(cfg);
13-
torrent::init_routes(cfg);
14-
category::init_routes(cfg);
15-
settings::init_routes(cfg);
16-
about::init_routes(cfg);
17-
proxy::init_routes(cfg);
18-
root::init_routes(cfg);
11+
pub fn init(cfg: &mut web::ServiceConfig) {
12+
user::init(cfg);
13+
torrent::init(cfg);
14+
category::init(cfg);
15+
settings::init(cfg);
16+
about::init(cfg);
17+
proxy::init(cfg);
18+
root::init(cfg);
1919
}

src/routes/proxy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ERROR_IMAGE_TOO_BIG_TEXT: &str = "Image is too big.";
2626
const ERROR_IMAGE_USER_QUOTA_MET_TEXT: &str = "Image proxy quota met.";
2727
const ERROR_IMAGE_UNAUTHENTICATED_TEXT: &str = "Sign in to see image.";
2828

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

3232
load_error_images();

src/routes/root.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ use actix_web::web;
22

33
use crate::routes::about;
44

5-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
5+
pub fn init(cfg: &mut web::ServiceConfig) {
66
cfg.service(web::scope("/").service(web::resource("").route(web::get().to(about::get))));
77
}

src/routes/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::config;
55
use crate::errors::{ServiceError, ServiceResult};
66
use crate::models::response::OkResponse;
77

8-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
8+
pub fn init(cfg: &mut web::ServiceConfig) {
99
cfg.service(
1010
web::scope("/settings")
1111
.service(

src/routes/torrent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::models::torrent::TorrentRequest;
1717
use crate::utils::parse_torrent;
1818
use crate::AsCSV;
1919

20-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
20+
pub fn init(cfg: &mut web::ServiceConfig) {
2121
cfg.service(
2222
web::scope("/torrent")
2323
.service(web::resource("/upload").route(web::post().to(upload_torrent)))

src/routes/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::models::user::UserAuthentication;
1616
use crate::utils::clock::current_time;
1717
use crate::utils::regex::validate_email_address;
1818

19-
pub fn init_routes(cfg: &mut web::ServiceConfig) {
19+
pub fn init(cfg: &mut web::ServiceConfig) {
2020
cfg.service(
2121
web::scope("/user")
2222
.service(web::resource("/register").route(web::post().to(register)))

0 commit comments

Comments
 (0)