File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ mod tests {
56
56
42
57
57
}
58
58
59
- let result = measure_operation ( "test_op" , || sample_operation ( ) ) . await ;
59
+ let result = measure_operation ( "test_op" , sample_operation) . await ;
60
60
assert_eq ! ( result, 42 ) ;
61
61
}
62
62
@@ -69,7 +69,7 @@ mod tests {
69
69
Err ( "test error" . to_string ( ) )
70
70
}
71
71
72
- let result = measure_operation ( "error_test" , || failing_operation ( ) ) . await ;
72
+ let result = measure_operation ( "error_test" , failing_operation) . await ;
73
73
assert ! ( result. is_err( ) ) ;
74
74
assert_eq ! ( result. unwrap_err( ) , "test error" ) ;
75
75
}
Original file line number Diff line number Diff line change @@ -93,12 +93,11 @@ fn check_non_null_column_without_default() {
93
93
let file = file. unwrap ( ) ;
94
94
if file. path ( ) . extension ( ) == Some ( OsStr :: new ( "sql" ) ) {
95
95
let contents =
96
- std:: fs:: read_to_string ( & file. path ( ) ) . expect ( "cannot read migration file" ) ;
96
+ std:: fs:: read_to_string ( file. path ( ) ) . expect ( "cannot read migration file" ) ;
97
97
98
- let ast = Parser :: parse_sql ( & PostgreSqlDialect { } , & contents) . expect ( & format ! (
99
- "Cannot parse migration {} as SQLL" ,
100
- file. path( ) . display( )
101
- ) ) ;
98
+ let ast = Parser :: parse_sql ( & PostgreSqlDialect { } , & contents) . unwrap_or_else ( |_| {
99
+ panic ! ( "Cannot parse migration {} as SQLL" , file. path( ) . display( ) )
100
+ } ) ;
102
101
let mut visitor = CheckNotNullWithoutDefault {
103
102
error : None ,
104
103
columns_set_to_not_null : Default :: default ( ) ,
You can’t perform that action at this time.
0 commit comments