Skip to content

Commit 893c5e3

Browse files
committed
cargo fmt
1 parent 93c46d3 commit 893c5e3

File tree

5 files changed

+8
-23
lines changed

5 files changed

+8
-23
lines changed

src/background_jobs.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,8 @@ impl Clone for Environment {
4141
}
4242

4343
impl Environment {
44-
pub fn new(
45-
index: Repository,
46-
uploader: Uploader,
47-
http_client: Client,
48-
) -> Self {
49-
Self::new_shared(
50-
Arc::new(Mutex::new(index)),
51-
uploader,
52-
http_client,
53-
)
44+
pub fn new(index: Repository, uploader: Uploader, http_client: Client) -> Self {
45+
Self::new_shared(Arc::new(Mutex::new(index)), uploader, http_client)
5446
}
5547

5648
pub fn new_shared(

src/bin/background-worker.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,9 @@ fn main() {
4040
println!("Index cloned");
4141

4242
let build_runner = || {
43-
let environment = Environment::new_shared(
44-
repository.clone(),
45-
config.uploader.clone(),
46-
Client::new(),
47-
);
48-
let db_config = r2d2::Pool::builder()
49-
.min_idle(Some(0));
43+
let environment =
44+
Environment::new_shared(repository.clone(), config.uploader.clone(), Client::new());
45+
let db_config = r2d2::Pool::builder().min_idle(Some(0));
5046
swirl::Runner::builder(environment)
5147
.connection_pool_builder(&db_url, db_config)
5248
.job_start_timeout(Duration::from_secs(job_start_timeout))

src/controllers/krate/publish.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ pub fn publish(req: &mut dyn Request) -> AppResult<Response> {
203203
yanked: Some(false),
204204
links,
205205
};
206-
git::add_crate(git_crate)
207-
.enqueue(&conn)?;
206+
git::add_crate(git_crate).enqueue(&conn)?;
208207

209208
// The `other` field on `PublishWarnings` was introduced to handle a temporary warning
210209
// that is no longer needed. As such, crates.io currently does not return any `other`

src/controllers/version/yank.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ fn modify_yank(req: &mut dyn Request, yanked: bool) -> AppResult<Response> {
4444

4545
insert_version_owner_action(&conn, version.id, user.id, ids.api_token_id(), action)?;
4646

47-
git::yank(krate.name, version, yanked)
48-
.enqueue(&conn)?;
47+
git::yank(krate.name, version, yanked).enqueue(&conn)?;
4948

5049
ok_true()
5150
}

src/db.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ pub fn diesel_pool(
7878
) -> DieselPool {
7979
let url = connection_url(url);
8080
if env == Env::Test {
81-
let conn =
82-
PgConnection::establish(&url).expect("failed to establish connection");
81+
let conn = PgConnection::establish(&url).expect("failed to establish connection");
8382
DieselPool::test_conn(conn)
8483
} else {
8584
let manager = ConnectionManager::new(url);

0 commit comments

Comments
 (0)