Skip to content

Commit 811e09a

Browse files
authored
Merge pull request #259 from xosnrdev/mkh
Make clippy happy
2 parents 855e904 + e24402f commit 811e09a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/utils/timing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod tests {
5656
42
5757
}
5858

59-
let result = measure_operation("test_op", || sample_operation()).await;
59+
let result = measure_operation("test_op", sample_operation).await;
6060
assert_eq!(result, 42);
6161
}
6262

@@ -69,7 +69,7 @@ mod tests {
6969
Err("test error".to_string())
7070
}
7171

72-
let result = measure_operation("error_test", || failing_operation()).await;
72+
let result = measure_operation("error_test", failing_operation).await;
7373
assert!(result.is_err());
7474
assert_eq!(result.unwrap_err(), "test error");
7575
}

tests/migrations.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ fn check_non_null_column_without_default() {
9393
let file = file.unwrap();
9494
if file.path().extension() == Some(OsStr::new("sql")) {
9595
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");
9797

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+
});
102101
let mut visitor = CheckNotNullWithoutDefault {
103102
error: None,
104103
columns_set_to_not_null: Default::default(),

0 commit comments

Comments
 (0)