Skip to content

Commit 5a6a0f8

Browse files
committed
Bump clippy and compile_error nightly
1 parent 54c7fa5 commit 5a6a0f8

5 files changed

Lines changed: 9 additions & 14 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ matrix:
3838
allow_failures:
3939
- rust: nightly
4040
include:
41-
- rust: nightly-2018-07-17
41+
- rust: nightly-2018-08-17
4242
env: CLIPPY_AND_COMPILE_TESTS=YESPLEASE
4343
script:
4444
- rustup component add clippy-preview
4545
- cargo clippy
46-
- (cd diesel_compile_tests && cargo update && cargo update -pproc-macro2 --precise "0.4.8" && travis-cargo test)
46+
- (cd diesel_compile_tests && travis-cargo test)
4747
- rust: 1.26.1
4848
env: RUSTFMT=YESPLEASE
4949
script:

diesel_compile_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = ["Sean Griffin <sean@seantheprogrammer.com>"]
77

88
[dependencies]
99
diesel = { version = "1.3.0", default-features = false, features = ["extras", "sqlite", "postgres", "mysql", "unstable"] }
10-
compiletest_rs = "=0.3.11"
10+
compiletest_rs = "=0.3.14"
1111

1212
[replace]
1313
"diesel:1.3.2" = { path = "../diesel" }

examples/mysql/getting_started_step_1/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ pub fn establish_connection() -> MysqlConnection {
1414

1515
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
1616
MysqlConnection::establish(&database_url)
17-
.expect(&format!("Error connecting to {}", database_url))
17+
.unwrap_or_else(|_| panic!("Error connecting to {}", database_url))
1818
}

examples/postgres/getting_started_step_3/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ pub fn establish_connection() -> PgConnection {
1515
dotenv().ok();
1616

1717
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
18-
PgConnection::establish(&database_url).expect(&format!("Error connecting to {}", database_url))
18+
PgConnection::establish(&database_url)
19+
.unwrap_or_else(|_| panic!("Error connecting to {}", database_url))
1920
}
2021

2122
pub fn create_post(conn: &PgConnection, title: &str, body: &str) -> Post {
2223
use schema::posts;
2324

24-
let new_post = NewPost {
25-
title: title,
26-
body: body,
27-
};
25+
let new_post = NewPost { title, body };
2826

2927
diesel::insert_into(posts::table)
3028
.values(&new_post)

examples/sqlite/getting_started_step_3/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ pub fn establish_connection() -> SqliteConnection {
1717

1818
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
1919
SqliteConnection::establish(&database_url)
20-
.expect(&format!("Error connecting to {}", database_url))
20+
.unwrap_or_else(|_| panic!("Error connecting to {}", database_url))
2121
}
2222

2323
pub fn create_post(conn: &SqliteConnection, title: &str, body: &str) -> usize {
2424
use schema::posts;
2525

26-
let new_post = NewPost {
27-
title: title,
28-
body: body,
29-
};
26+
let new_post = NewPost { title, body };
3027

3128
diesel::insert_into(posts::table)
3229
.values(&new_post)

0 commit comments

Comments
 (0)