on main help sign in
Fix clippy warnings
d281106fabianlindfors
src/migrations/alter_column.rs+6−2
@@ -57,10 +57,14 @@ impl Action for AlterColumn {
57
57
58 // Add temporary, nullable column
58 // Add temporary, nullable column
59 let mut temp_column_definition_parts: Vec<&str> =
59 let mut temp_column_definition_parts: Vec<&str> =
60− vec![&temporary_column_name, &temporary_column_type];
60+ vec![&temporary_column_name, temporary_column_type];
61
61
62 // Use either new default value or existing one if one exists
62 // Use either new default value or existing one if one exists
63− let default_value = self.changes.default.as_ref().or(column.default.as_ref());
63+ let default_value = self
64+ .changes
65+ .default
66+ .as_ref()
67+ .or_else(|| column.default.as_ref());
64 if let Some(default) = default_value {
68 if let Some(default) = default_value {
65 temp_column_definition_parts.push("DEFAULT");
69 temp_column_definition_parts.push("DEFAULT");
66 temp_column_definition_parts.push(default);
70 temp_column_definition_parts.push(default);