Skip to content

Commit 7a4006d

Browse files
committed
rustfmt
1 parent 137b928 commit 7a4006d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/publish_rate_limit.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ impl PublishRateLimit {
8484
);
8585

8686
diesel::insert_into(publish_limit_buckets)
87-
.values((
88-
user_id.eq(uploader),
89-
tokens.eq(burst),
90-
last_refill.eq(now),
91-
))
87+
.values((user_id.eq(uploader), tokens.eq(burst), last_refill.eq(now)))
9288
.on_conflict(user_id)
9389
.do_update()
9490
.set((

src/tests/krate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,6 @@ fn publish_rate_limit_doesnt_affect_existing_crates() {
21772177
let crate_to_publish = PublishBuilder::new("rate_limited1");
21782178
token.publish(crate_to_publish).good();
21792179

2180-
let new_version = PublishBuilder::new("rate_limited1")
2181-
.version("1.0.1");
2180+
let new_version = PublishBuilder::new("rate_limited1").version("1.0.1");
21822181
token.publish(new_version).good();
21832182
}

src/util/errors.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,18 @@ impl CargoError for TooManyRequests {
401401

402402
let mut response = json_response(&Bad {
403403
errors: vec![StringError {
404-
detail: format!("You have published too many crates in a \
405-
short period of time. Please try again after {} or email \
406-
[email protected] to have your limit increased.", retry_after),
404+
detail: format!(
405+
"You have published too many crates in a \
406+
short period of time. Please try again after {} or email \
407+
[email protected] to have your limit increased.",
408+
retry_after
409+
),
407410
}],
408411
});
409412
response.status = (429, "TOO MANY REQUESTS");
410-
response.headers.insert("Retry-After".into(), vec![retry_after.to_string()]);
413+
response
414+
.headers
415+
.insert("Retry-After".into(), vec![retry_after.to_string()]);
411416
Some(response)
412417
}
413418

0 commit comments

Comments
 (0)