Skip to content

Commit f42fc3a

Browse files
committed
Fix clippy
1 parent b72a014 commit f42fc3a

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

crates/vespertide-planner/src/apply.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,8 @@ fn clear_inline_constraint_fields(
309309
if filtered.is_empty() {
310310
col.index = None;
311311
} else if filtered.len() < names.len() {
312-
col.index = Some(vespertide_core::StrOrBoolOrArray::Array(
313-
filtered,
314-
));
312+
col.index =
313+
Some(vespertide_core::StrOrBoolOrArray::Array(filtered));
315314
}
316315
}
317316
_ => {}
@@ -912,7 +911,7 @@ mod tests {
912911
// Column with inline index: ["idx_single"]
913912
let mut col_with_index = col("email", ColumnType::Simple(SimpleColumnType::Text));
914913
col_with_index.index = Some(vespertide_core::StrOrBoolOrArray::Array(vec![
915-
"idx_single".into()
914+
"idx_single".into(),
916915
]));
917916

918917
let mut schema = vec![table(
@@ -1011,7 +1010,7 @@ mod tests {
10111010
// Column with inline unique: ["uq_email"] (only one item in array)
10121011
let mut col_with_unique = col("email", ColumnType::Simple(SimpleColumnType::Text));
10131012
col_with_unique.unique = Some(vespertide_core::StrOrBoolOrArray::Array(vec![
1014-
"uq_email".to_string()
1013+
"uq_email".to_string(),
10151014
]));
10161015

10171016
let mut schema = vec![table(

crates/vespertide-planner/src/diff.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ fn constraints_same_identity(a: &TableConstraint, b: &TableConstraint) -> bool {
3939
cols_a == cols_b && rt_a == rt_b && rc_a == rc_b
4040
}
4141
(
42-
TableConstraint::Check {
43-
name: name_a, ..
44-
},
45-
TableConstraint::Check {
46-
name: name_b, ..
47-
},
42+
TableConstraint::Check { name: name_a, .. },
43+
TableConstraint::Check { name: name_b, .. },
4844
) => name_a == name_b,
4945
(
5046
TableConstraint::Unique {

crates/vespertide-query/src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use vespertide_core::{MigrationAction, MigrationPlan, TableDef};
22
use vespertide_planner::apply_action;
33

4+
use crate::DatabaseBackend;
45
use crate::error::QueryError;
5-
use crate::sql::build_action_queries_with_pending;
66
use crate::sql::BuiltQuery;
7-
use crate::DatabaseBackend;
7+
use crate::sql::build_action_queries_with_pending;
88

99
pub struct PlanQueries {
1010
pub action: MigrationAction,
@@ -807,8 +807,8 @@ mod tests {
807807
#[case] label: &str,
808808
#[case] backend: DatabaseBackend,
809809
) {
810-
use vespertide_core::schema::str_or_bool::StrOrBoolOrArray;
811810
use vespertide_core::DefaultValue;
811+
use vespertide_core::schema::str_or_bool::StrOrBoolOrArray;
812812

813813
let schema = vec![TableDef {
814814
name: "article".into(),

0 commit comments

Comments
 (0)