File tree Expand file tree Collapse file tree
diesel_migrations/migrations_macros/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- extern crate dotenv;
2- #[ macro_use] extern crate cfg_if;
3-
41use 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-
199195mod schema {
200196 use diesel:: prelude:: * ;
201197
Original file line number Diff line number Diff line change 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,
You can’t perform that action at this time.
0 commit comments