@@ -4,7 +4,7 @@ use diesel::result::Error::NotFound;
44
55use super :: data_structures:: * ;
66use super :: table_data:: * ;
7- use database:: InferConnection ;
7+ use crate :: database:: InferConnection ;
88
99static RESERVED_NAMES : & [ & str ] = & [
1010 "abstract" , "alignof" , "as" , "become" , "box" , "break" , "const" , "continue" , "crate" , "do" ,
@@ -17,8 +17,8 @@ static RESERVED_NAMES: &[&str] = &[
1717pub fn load_table_names (
1818 database_url : & str ,
1919 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) ) ;
2222
2323 match connection {
2424 #[ cfg( feature = "sqlite" ) ]
@@ -33,7 +33,7 @@ pub fn load_table_names(
3333fn get_column_information (
3434 conn : & InferConnection ,
3535 table : & TableName ,
36- ) -> Result < Vec < ColumnInformation > , Box < Error > > {
36+ ) -> Result < Vec < ColumnInformation > , Box < dyn Error > > {
3737 let column_info = match * conn {
3838 #[ cfg( feature = "sqlite" ) ]
3939 InferConnection :: Sqlite ( ref c) => super :: sqlite:: get_table_data ( c, table) ,
@@ -52,7 +52,7 @@ fn get_column_information(
5252fn determine_column_type (
5353 attr : & ColumnInformation ,
5454 conn : & InferConnection ,
55- ) -> Result < ColumnType , Box < Error > > {
55+ ) -> Result < ColumnType , Box < dyn Error > > {
5656 match * conn {
5757 #[ cfg( feature = "sqlite" ) ]
5858 InferConnection :: Sqlite ( _) => super :: sqlite:: determine_column_type ( attr) ,
@@ -66,8 +66,8 @@ fn determine_column_type(
6666pub ( crate ) fn get_primary_keys (
6767 conn : & InferConnection ,
6868 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 {
7171 #[ cfg( feature = "sqlite" ) ]
7272 InferConnection :: Sqlite ( ref c) => super :: sqlite:: get_primary_keys( c, table) ,
7373 #[ cfg( feature = "postgres" ) ]
@@ -89,8 +89,8 @@ pub(crate) fn get_primary_keys(
8989pub fn load_foreign_key_constraints (
9090 database_url : & str ,
9191 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) ) ;
9494
9595 let constraints = match connection {
9696 #[ cfg( feature = "sqlite" ) ]
@@ -122,7 +122,7 @@ macro_rules! doc_comment {
122122 } ;
123123}
124124
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 > > {
126126 let connection = InferConnection :: establish ( database_url) ?;
127127 let docs = doc_comment ! (
128128 "Representation of the `{}` table.
@@ -167,7 +167,7 @@ pub fn load_table_data(database_url: &str, name: TableName) -> Result<TableData,
167167 rust_name,
168168 has_default : c. has_default ,
169169 } )
170- } ) . collect :: < Result < _ , Box < Error > > > ( ) ?;
170+ } ) . collect :: < Result < _ , Box < dyn Error > > > ( ) ?;
171171
172172 Ok ( TableData {
173173 name,
0 commit comments