@@ -4,7 +4,7 @@ use diesel::result::Error::NotFound;
4
4
5
5
use super :: data_structures:: * ;
6
6
use super :: table_data:: * ;
7
- use database:: InferConnection ;
7
+ use crate :: database:: InferConnection ;
8
8
9
9
static RESERVED_NAMES : & [ & str ] = & [
10
10
"abstract" , "alignof" , "as" , "become" , "box" , "break" , "const" , "continue" , "crate" , "do" ,
@@ -17,8 +17,8 @@ static RESERVED_NAMES: &[&str] = &[
17
17
pub fn load_table_names (
18
18
database_url : & str ,
19
19
schema_name : Option < & str > ,
20
- ) -> Result < Vec < TableName > , Box < Error > > {
21
- let connection = try!( InferConnection :: establish ( database_url) ) ;
20
+ ) -> Result < Vec < TableName > , Box < dyn Error > > {
21
+ let connection = r# try! ( InferConnection :: establish( database_url) ) ;
22
22
23
23
match connection {
24
24
#[ cfg( feature = "sqlite" ) ]
@@ -33,7 +33,7 @@ pub fn load_table_names(
33
33
fn get_column_information (
34
34
conn : & InferConnection ,
35
35
table : & TableName ,
36
- ) -> Result < Vec < ColumnInformation > , Box < Error > > {
36
+ ) -> Result < Vec < ColumnInformation > , Box < dyn Error > > {
37
37
let column_info = match * conn {
38
38
#[ cfg( feature = "sqlite" ) ]
39
39
InferConnection :: Sqlite ( ref c) => super :: sqlite:: get_table_data ( c, table) ,
@@ -52,7 +52,7 @@ fn get_column_information(
52
52
fn determine_column_type (
53
53
attr : & ColumnInformation ,
54
54
conn : & InferConnection ,
55
- ) -> Result < ColumnType , Box < Error > > {
55
+ ) -> Result < ColumnType , Box < dyn Error > > {
56
56
match * conn {
57
57
#[ cfg( feature = "sqlite" ) ]
58
58
InferConnection :: Sqlite ( _) => super :: sqlite:: determine_column_type ( attr) ,
@@ -66,8 +66,8 @@ fn determine_column_type(
66
66
pub ( crate ) fn get_primary_keys (
67
67
conn : & InferConnection ,
68
68
table : & TableName ,
69
- ) -> Result < Vec < String > , Box < Error > > {
70
- let primary_keys: Vec < String > = try!( match * conn {
69
+ ) -> Result < Vec < String > , Box < dyn Error > > {
70
+ let primary_keys: Vec < String > = r# try! ( match * conn {
71
71
#[ cfg( feature = "sqlite" ) ]
72
72
InferConnection :: Sqlite ( ref c) => super :: sqlite:: get_primary_keys( c, table) ,
73
73
#[ cfg( feature = "postgres" ) ]
@@ -89,8 +89,8 @@ pub(crate) fn get_primary_keys(
89
89
pub fn load_foreign_key_constraints (
90
90
database_url : & str ,
91
91
schema_name : Option < & str > ,
92
- ) -> Result < Vec < ForeignKeyConstraint > , Box < Error > > {
93
- let connection = try!( InferConnection :: establish ( database_url) ) ;
92
+ ) -> Result < Vec < ForeignKeyConstraint > , Box < dyn Error > > {
93
+ let connection = r# try! ( InferConnection :: establish( database_url) ) ;
94
94
95
95
let constraints = match connection {
96
96
#[ cfg( feature = "sqlite" ) ]
@@ -122,7 +122,7 @@ macro_rules! doc_comment {
122
122
} ;
123
123
}
124
124
125
- pub fn load_table_data ( database_url : & str , name : TableName ) -> Result < TableData , Box < Error > > {
125
+ pub fn load_table_data ( database_url : & str , name : TableName ) -> Result < TableData , Box < dyn Error > > {
126
126
let connection = InferConnection :: establish ( database_url) ?;
127
127
let docs = doc_comment ! (
128
128
"Representation of the `{}` table.
@@ -167,7 +167,7 @@ pub fn load_table_data(database_url: &str, name: TableName) -> Result<TableData,
167
167
rust_name,
168
168
has_default : c. has_default ,
169
169
} )
170
- } ) . collect :: < Result < _ , Box < Error > > > ( ) ?;
170
+ } ) . collect :: < Result < _ , Box < dyn Error > > > ( ) ?;
171
171
172
172
Ok ( TableData {
173
173
name,
0 commit comments