Skip to content

Commit

Permalink
typosquat: move to top level module
Browse files Browse the repository at this point in the history
  • Loading branch information
LawnGnome committed Nov 14, 2023
1 parent 9baa7d6 commit c176ab6
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub mod sql;
pub mod ssh;
pub mod storage;
mod test_util;
pub mod typosquat;
pub mod util;
pub mod views;
pub mod worker;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl From<crate::models::Owner> for Owner {

#[cfg(test)]
mod tests {
use crate::{test_util::pg_connection, worker::typosquat::test_util::Faker};
use crate::{test_util::pg_connection, typosquat::test_util::Faker};
use thiserror::Error;

use super::*;
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions src/worker/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::cloudfront::CloudFront;
use crate::db::DieselPool;
use crate::fastly::Fastly;
use crate::storage::Storage;
use crate::typosquat;
use crate::Emails;
use crates_io_index::{Repository, RepositoryConfig};
use diesel::PgConnection;
Expand All @@ -10,8 +11,6 @@ use std::ops::{Deref, DerefMut};
use std::sync::{Arc, OnceLock};
use std::time::Instant;

use super::typosquat;

pub struct Environment {
repository_config: RepositoryConfig,
repository: Mutex<Option<Repository>>,
Expand Down
9 changes: 3 additions & 6 deletions src/worker/jobs/typosquat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ use diesel::PgConnection;
use typomania::Package;

use crate::{
worker::{
swirl::BackgroundJob,
typosquat::{Cache, Crate},
Environment,
},
typosquat::{Cache, Crate},
worker::{swirl::BackgroundJob, Environment},
Emails,
};

Expand Down Expand Up @@ -67,7 +64,7 @@ fn check(

#[cfg(test)]
mod tests {
use crate::{test_util::pg_connection, worker::typosquat::test_util::Faker};
use crate::{test_util::pg_connection, typosquat::test_util::Faker};

use super::*;

Expand Down
1 change: 0 additions & 1 deletion src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::sync::Arc;
mod environment;
pub mod jobs;
pub mod swirl;
mod typosquat;

pub use self::environment::Environment;

Expand Down

0 comments on commit c176ab6

Please sign in to comment.