@@ -11,8 +11,8 @@ use thiserror::Error;
1111#[ derive( Error , Debug ) ]
1212pub struct MigrateError {
1313 kind : MigrateErrorKind ,
14- statement_a : Option < Statement > ,
15- statement_b : Option < Statement > ,
14+ statement_a : Option < Box < Statement > > ,
15+ statement_b : Option < Box < Statement > > ,
1616}
1717
1818impl fmt:: Display for MigrateError {
@@ -42,8 +42,8 @@ impl MigrateError {
4242 ) -> Self {
4343 Self {
4444 kind,
45- statement_a,
46- statement_b,
45+ statement_a : statement_a . map ( Box :: new ) ,
46+ statement_b : statement_b . map ( Box :: new ) ,
4747 }
4848 }
4949}
@@ -54,9 +54,9 @@ enum MigrateErrorKind {
5454 #[ error( "can't migrate unnamed index" ) ]
5555 UnnamedIndex ,
5656 #[ error( "ALTER TABLE operation \" {0}\" not yet supported" ) ]
57- AlterTableOpNotImplemented ( AlterTableOperation ) ,
57+ AlterTableOpNotImplemented ( Box < AlterTableOperation > ) ,
5858 #[ error( "invalid ALTER TYPE operation \" {0}\" " ) ]
59- AlterTypeInvalidOp ( AlterTypeOperation ) ,
59+ AlterTypeInvalidOp ( Box < AlterTypeOperation > ) ,
6060 #[ error( "not yet supported" ) ]
6161 NotImplemented ,
6262}
@@ -325,7 +325,9 @@ fn migrate_alter_table(
325325 }
326326 op => {
327327 return Err ( MigrateError :: builder ( )
328- . kind ( MigrateErrorKind :: AlterTableOpNotImplemented ( op. clone ( ) ) )
328+ . kind ( MigrateErrorKind :: AlterTableOpNotImplemented ( Box :: new (
329+ op. clone ( ) ,
330+ ) ) )
329331 . statement_a ( Statement :: CreateTable ( t. clone ( ) ) )
330332 . build ( ) )
331333 }
@@ -380,9 +382,9 @@ fn migrate_alter_type(
380382 Ok ( ( name, UserDefinedTypeRepresentation :: Enum { labels } ) )
381383 }
382384 UserDefinedTypeRepresentation :: Composite { .. } => Err ( MigrateError :: builder ( )
383- . kind ( MigrateErrorKind :: AlterTypeInvalidOp (
385+ . kind ( MigrateErrorKind :: AlterTypeInvalidOp ( Box :: new (
384386 other. operation . clone ( ) ,
385- ) )
387+ ) ) )
386388 . statement_a ( Statement :: CreateType {
387389 name,
388390 representation,
@@ -400,9 +402,9 @@ fn migrate_alter_type(
400402 Ok ( ( name, UserDefinedTypeRepresentation :: Enum { labels } ) )
401403 }
402404 UserDefinedTypeRepresentation :: Composite { .. } => Err ( MigrateError :: builder ( )
403- . kind ( MigrateErrorKind :: AlterTypeInvalidOp (
405+ . kind ( MigrateErrorKind :: AlterTypeInvalidOp ( Box :: new (
404406 other. operation . clone ( ) ,
405- ) )
407+ ) ) )
406408 . statement_a ( Statement :: CreateType {
407409 name,
408410 representation,
0 commit comments