Skip to content

Commit 323d221

Browse files
committed
typosquat: move to top level module
1 parent bc17c43 commit 323d221

File tree

9 files changed

+6
-10
lines changed

9 files changed

+6
-10
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub mod sql;
5959
pub mod ssh;
6060
pub mod storage;
6161
mod test_util;
62+
pub mod typosquat;
6263
pub mod util;
6364
pub mod views;
6465
pub mod worker;
File renamed without changes.
File renamed without changes.

src/worker/typosquat/database.rs renamed to src/typosquat/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl From<crate::models::Owner> for Owner {
161161

162162
#[cfg(test)]
163163
mod tests {
164-
use crate::{test_util::pg_connection, worker::typosquat::test_util::Faker};
164+
use crate::{test_util::pg_connection, typosquat::test_util::Faker};
165165
use thiserror::Error;
166166

167167
use super::*;
File renamed without changes.
File renamed without changes.

src/worker/environment.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::cloudfront::CloudFront;
22
use crate::db::DieselPool;
33
use crate::fastly::Fastly;
44
use crate::storage::Storage;
5+
use crate::typosquat;
56
use crate::Emails;
67
use crates_io_index::{Repository, RepositoryConfig};
78
use diesel::PgConnection;
@@ -10,8 +11,6 @@ use std::ops::{Deref, DerefMut};
1011
use std::sync::{Arc, OnceLock};
1112
use std::time::Instant;
1213

13-
use super::typosquat;
14-
1514
pub struct Environment {
1615
repository_config: RepositoryConfig,
1716
repository: Mutex<Option<Repository>>,

src/worker/jobs/typosquat.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ use diesel::PgConnection;
44
use typomania::Package;
55

66
use crate::{
7-
worker::{
8-
swirl::BackgroundJob,
9-
typosquat::{Cache, Crate},
10-
Environment,
11-
},
7+
typosquat::{Cache, Crate},
8+
worker::{swirl::BackgroundJob, Environment},
129
Emails,
1310
};
1411

@@ -67,7 +64,7 @@ fn check(
6764

6865
#[cfg(test)]
6966
mod tests {
70-
use crate::{test_util::pg_connection, worker::typosquat::test_util::Faker};
67+
use crate::{test_util::pg_connection, typosquat::test_util::Faker};
7168

7269
use super::*;
7370

src/worker/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use std::sync::Arc;
1111
mod environment;
1212
pub mod jobs;
1313
pub mod swirl;
14-
mod typosquat;
1514

1615
pub use self::environment::Environment;
1716

0 commit comments

Comments
 (0)