Skip to content

Commit 9adaa4b

Browse files
committed
Clippy fixes
1 parent 8adf11b commit 9adaa4b

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

diesel/src/doctest_setup.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
extern crate dotenv;
2-
#[macro_use] extern crate cfg_if;
3-
41
use diesel::prelude::*;
5-
use self::dotenv::dotenv;
2+
use dotenv::dotenv;
63

7-
cfg_if! {
4+
cfg_if::cfg_if! {
85
if #[cfg(feature = "postgres")] {
96
#[allow(dead_code)]
107
type DB = diesel::pg::Pg;
@@ -104,7 +101,7 @@ cfg_if! {
104101
(1, 'My first post'),
105102
(1, 'About Rust'),
106103
(2, 'My first post too')").unwrap();
107-
104+
108105
connection.execute("CREATE TABLE comments (
109106
id INTEGER PRIMARY KEY AUTOINCREMENT,
110107
post_id INTEGER NOT NULL,
@@ -161,7 +158,7 @@ cfg_if! {
161158
(1, 'My first post'),
162159
(1, 'About Rust'),
163160
(2, 'My first post too')").unwrap();
164-
161+
165162
connection.execute("CREATE TABLE comments (
166163
id INTEGER PRIMARY KEY AUTO_INCREMENT,
167164
post_id INTEGER NOT NULL,
@@ -195,7 +192,6 @@ fn database_url_from_env(backend_specific_env_var: &str) -> String {
195192
.expect("DATABASE_URL must be set in order to run tests")
196193
}
197194

198-
199195
mod schema {
200196
use diesel::prelude::*;
201197

diesel_migrations/migrations_macros/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
clippy::option_map_unwrap_or_else,
66
clippy::option_map_unwrap_or,
77
clippy::match_same_arms,
8-
clippy::type_complexity
8+
clippy::type_complexity,
9+
clippy::needless_doctest_main
910
)]
1011
#![warn(
1112
clippy::option_unwrap_used,

0 commit comments

Comments
 (0)