Skip to content

Commit 69a7d27

Browse files
committed
Bump rustfmt to latest nightly
1 parent 3edb94b commit 69a7d27

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ matrix:
3939
allow_failures:
4040
- rust: nightly
4141
include:
42-
- rust: nightly-2017-09-20
42+
- rust: nightly-2017-11-07
4343
env: RUSTFMT=YESPLEASE
4444
script:
45-
- cargo install --force rustfmt-nightly --vers 0.2.7
45+
- cargo install --force rustfmt-nightly --vers 0.2.15
4646
- export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH
4747
- rustfmt --version
4848
- cargo fmt -- --write-mode=diff

src/badge.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ impl Badge {
107107
delete(badges::table)
108108
.filter(badges::crate_id.eq(krate.id))
109109
.execute(conn)?;
110-
insert_into(badges::table).values(&new_badges).execute(conn)?;
110+
insert_into(badges::table)
111+
.values(&new_badges)
112+
.execute(conn)?;
111113
Ok(invalid_badges)
112114
})
113115
}

src/keyword.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ pub fn index(req: &mut Request) -> CargoResult<Response> {
128128
query = query.order(keywords::keyword.asc());
129129
}
130130

131-
let data = query.paginate(limit, offset).load::<(Keyword, i64)>(&*conn)?;
131+
let data = query
132+
.paginate(limit, offset)
133+
.load::<(Keyword, i64)>(&*conn)?;
132134
let total = data.get(0).map(|&(_, t)| t).unwrap_or(0);
133135
let kws = data.into_iter()
134136
.map(|(k, _)| k.encodable())

src/render.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ mod tests {
270270

271271
#[test]
272272
fn text_with_inline_javascript() {
273-
let text = r#"foo_readme\n\n<a href="https://crates.io/crates/cargo-registry" onclick="window.alert('Got you')">Crate page</a>"#;
273+
let text =
274+
r#"foo_readme\n\n<a href="https://crates.io/crates/cargo-registry" onclick="window.alert('Got you')">Crate page</a>"#;
274275
let result = markdown_to_html(text, None).unwrap();
275276
assert_eq!(
276277
result,
@@ -345,7 +346,8 @@ mod tests {
345346

346347
#[test]
347348
fn absolute_links_dont_get_resolved() {
348-
let readme_text = "[![Crates.io](https://img.shields.io/crates/v/clap.svg)](https://crates.io/crates/clap)";
349+
let readme_text =
350+
"[![Crates.io](https://img.shields.io/crates/v/clap.svg)](https://crates.io/crates/clap)";
349351
let repository = "https://github.com/kbknapp/clap-rs/";
350352
let result = markdown_to_html(readme_text, Some(&repository)).unwrap();
351353

@@ -387,7 +389,8 @@ mod tests {
387389

388390
#[test]
389391
fn manual_anchor_is_sanitized() {
390-
let text = "<h1><a href=\"#my-crate\" id=\"my-crate\"></a>My crate</h1>\n<p>Hello, world!</p>\n";
392+
let text =
393+
"<h1><a href=\"#my-crate\" id=\"my-crate\"></a>My crate</h1>\n<p>Hello, world!</p>\n";
391394
let result = markdown_to_html(text, None).unwrap();
392395
assert_eq!(
393396
result,

src/tests/all.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ impl<'a> CrateBuilder<'a> {
408408
fn build(mut self, connection: &PgConnection) -> CargoResult<Crate> {
409409
use diesel::{insert_into, update};
410410

411-
let mut krate = self.krate.create_or_update(connection, None, self.owner_id)?;
411+
let mut krate = self.krate
412+
.create_or_update(connection, None, self.owner_id)?;
412413

413414
// Since we are using `NewCrate`, we can't set all the
414415
// crate properties in a single DB call.

src/tests/user.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ fn test_github_login_does_not_overwrite_email() {
381381
assert_eq!(r.user.email, None);
382382
assert_eq!(r.user.login, "apricot");
383383

384-
let body = r#"{"user":{"email":"[email protected]","name":"Apricot Apricoto","login":"apricot","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/apricot","kind":null}}"#;
384+
let body =
385+
r#"{"user":{"email":"[email protected]","name":"Apricot Apricoto","login":"apricot","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/apricot","kind":null}}"#;
385386
let mut response = ok_resp!(
386387
middle.call(
387388
req.with_path(&format!("/api/v1/users/{}", user.id))
@@ -440,7 +441,8 @@ fn test_email_get_and_put() {
440441
assert_eq!(r.user.email, None);
441442
assert_eq!(r.user.login, "mango");
442443

443-
let body = r#"{"user":{"email":"[email protected]","name":"Mango McMangoface","login":"mango","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/mango","kind":null}}"#;
444+
let body =
445+
r#"{"user":{"email":"[email protected]","name":"Mango McMangoface","login":"mango","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/mango","kind":null}}"#;
444446
let mut response = ok_resp!(
445447
middle.call(
446448
req.with_path(&format!("/api/v1/users/{}", user.id))
@@ -479,7 +481,8 @@ fn test_empty_email_not_added() {
479481
user
480482
};
481483

482-
let body = r#"{"user":{"email":"","name":"Papayo Papaya","login":"papaya","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/papaya","kind":null}}"#;
484+
let body =
485+
r#"{"user":{"email":"","name":"Papayo Papaya","login":"papaya","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/papaya","kind":null}}"#;
483486
let json = bad_resp!(
484487
middle.call(
485488
req.with_path(&format!("/api/v1/users/{}", user.id))
@@ -494,7 +497,8 @@ fn test_empty_email_not_added() {
494497
json.errors
495498
);
496499

497-
let body = r#"{"user":{"email":null,"name":"Papayo Papaya","login":"papaya","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/papaya","kind":null}}"#;
500+
let body =
501+
r#"{"user":{"email":null,"name":"Papayo Papaya","login":"papaya","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/papaya","kind":null}}"#;
498502
let json = bad_resp!(
499503
middle.call(
500504
req.with_path(&format!("/api/v1/users/{}", user.id))
@@ -531,7 +535,8 @@ fn test_this_user_cannot_change_that_user_email() {
531535
unsigned_user
532536
};
533537

534-
let body = r#"{"user":{"email":"[email protected]","name":"Pine Apple","login":"pineapple","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/pineapple","kind":null}}"#;
538+
let body =
539+
r#"{"user":{"email":"[email protected]","name":"Pine Apple","login":"pineapple","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/pineapple","kind":null}}"#;
535540

536541
let json = bad_resp!(
537542
middle.call(
@@ -642,7 +647,8 @@ fn test_insert_into_email_table_with_email_change() {
642647
assert!(!r.user.email_verified);
643648
assert!(r.user.email_verification_sent);
644649

645-
let body = r#"{"user":{"email":"[email protected]","name":"potato","login":"potato","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/potato","kind":null}}"#;
650+
let body =
651+
r#"{"user":{"email":"[email protected]","name":"potato","login":"potato","avatar":"https://avatars0.githubusercontent.com","url":"https://github.com/potato","kind":null}}"#;
646652
let mut response = ok_resp!(
647653
middle.call(
648654
req.with_path(&format!("/api/v1/users/{}", user.id))

src/version/deprecated.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ pub fn index(req: &mut Request) -> CargoResult<Response> {
2424
// Extract all ids requested.
2525
let query = url::form_urlencoded::parse(req.query_string().unwrap_or("").as_bytes());
2626
let ids = query
27-
.filter_map(|(ref a, ref b)| if *a == "ids[]" {
28-
b.parse().ok()
29-
} else {
30-
None
31-
})
27+
.filter_map(|(ref a, ref b)| if *a == "ids[]" { b.parse().ok() } else { None })
3228
.collect::<Vec<i32>>();
3329

3430
let versions = versions::table

0 commit comments

Comments
 (0)