Skip to content

Commit d23b66b

Browse files
committed
Remove unused modules
1 parent 3873cdc commit d23b66b

File tree

4 files changed

+5
-134
lines changed

4 files changed

+5
-134
lines changed

atcoder-problems-backend/src/server/auth.rs

Lines changed: 0 additions & 81 deletions
This file was deleted.

atcoder-problems-backend/src/server/mod.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pub(crate) mod auth;
21
pub mod endpoint;
32
pub mod error;
43
pub(crate) mod language_count;
@@ -8,11 +7,9 @@ pub(crate) mod services;
87
pub(crate) mod time_submissions;
98
pub(crate) mod user_info;
109
pub(crate) mod user_submissions;
11-
pub(crate) mod utils;
1210

1311
use actix_web::{http::header, web, App, HttpResponseBuilder, HttpServer};
1412
use anyhow::Result;
15-
pub use auth::{Authentication, GitHubAuthentication, GitHubUserResponse};
1613
pub use services::config_services;
1714

1815
use self::middleware::github_auth::{GithubAuthentication, GithubClient};
@@ -50,26 +47,3 @@ impl MakeCors for HttpResponseBuilder {
5047
self.insert_header((header::ACCESS_CONTROL_ALLOW_ORIGIN, "*"))
5148
}
5249
}
53-
54-
pub struct AppData<A> {
55-
pub(crate) authentication: A,
56-
pub(crate) pg_pool: sql_client::PgPool,
57-
}
58-
59-
impl<A: Clone> Clone for AppData<A> {
60-
fn clone(&self) -> Self {
61-
Self {
62-
pg_pool: self.pg_pool.clone(),
63-
authentication: self.authentication.clone(),
64-
}
65-
}
66-
}
67-
68-
impl<A> AppData<A> {
69-
pub fn new(pg_pool: sql_client::PgPool, authentication: A) -> Self {
70-
Self {
71-
authentication,
72-
pg_pool,
73-
}
74-
}
75-
}

atcoder-problems-backend/src/server/utils.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

atcoder-problems-backend/tests/test_server_e2e_problem_list.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use reqwest::header::SET_COOKIE;
66
use serde_json::{json, Value};
77

88
pub mod utils;
9-
use utils::start_mock_github_server;
109

1110
const VALID_CODE: &str = "valid-code";
1211
const VALID_TOKEN: &str = "valid-token";
@@ -24,7 +23,7 @@ async fn setup() -> u16 {
2423
#[actix_web::test]
2524
async fn test_list() {
2625
let port = setup().await;
27-
let mock_server = start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
26+
let mock_server = utils::start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
2827
let mock_server_base_url = mock_server.base_url();
2928
let server = actix_web::rt::spawn(async move {
3029
let pg_pool = sql_client::initialize_pool(utils::get_sql_url_from_env())
@@ -195,7 +194,7 @@ async fn test_list() {
195194
#[actix_web::test]
196195
async fn test_invalid_token() {
197196
let port = setup().await;
198-
let mock_server = start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
197+
let mock_server = utils::start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
199198
let mock_server_base_url = mock_server.base_url();
200199
let server = actix_web::rt::spawn(async move {
201200
let pg_pool = sql_client::initialize_pool(utils::get_sql_url_from_env())
@@ -240,7 +239,7 @@ async fn test_invalid_token() {
240239
#[actix_web::test]
241240
async fn test_list_item() {
242241
let port = setup().await;
243-
let mock_server = start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
242+
let mock_server = utils::start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
244243
let mock_server_base_url = mock_server.base_url();
245244
let server = actix_web::rt::spawn(async move {
246245
let pg_pool = sql_client::initialize_pool(utils::get_sql_url_from_env())
@@ -387,7 +386,7 @@ async fn test_list_item() {
387386
#[actix_web::test]
388387
async fn test_list_delete() {
389388
let port = setup().await;
390-
let mock_server = start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
389+
let mock_server = utils::start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
391390
let mock_server_base_url = mock_server.base_url();
392391
let server = actix_web::rt::spawn(async move {
393392
let pg_pool = sql_client::initialize_pool(utils::get_sql_url_from_env())
@@ -475,7 +474,7 @@ async fn test_list_delete() {
475474
#[actix_web::test]
476475
async fn test_register_twice() {
477476
let port = setup().await;
478-
let mock_server = start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
477+
let mock_server = utils::start_mock_github_server(VALID_TOKEN, GithubToken { id: 0 });
479478
let mock_server_base_url = mock_server.base_url();
480479
let server = actix_web::rt::spawn(async move {
481480
let pg_pool = sql_client::initialize_pool(utils::get_sql_url_from_env())

0 commit comments

Comments
 (0)