File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,9 +45,8 @@ impl Opts {
4545 }
4646}
4747
48- #[ derive( Debug ) ]
48+ #[ derive( Debug , Default ) ]
4949struct Return {
50- return_multiple : bool ,
5150 scalar : Option < Scalar > ,
5251 retptrs : Vec < Type > ,
5352}
@@ -876,11 +875,7 @@ impl InterfaceGenerator<'_> {
876875 name : String :: from ( "INVALID" ) ,
877876 sig : String :: from ( "INVALID" ) ,
878877 params : Vec :: new ( ) ,
879- ret : Return {
880- return_multiple : false ,
881- scalar : None ,
882- retptrs : Vec :: new ( ) ,
883- } ,
878+ ret : Return :: default ( ) ,
884879 retptrs : Vec :: new ( ) ,
885880 } ;
886881 for ( i, result) in sig. results . iter ( ) . enumerate ( ) {
@@ -1041,19 +1036,14 @@ impl InterfaceGenerator<'_> {
10411036 }
10421037
10431038 fn classify_ret ( & mut self , func : & Function ) -> Return {
1044- let mut ret = Return {
1045- return_multiple : false ,
1046- scalar : None ,
1047- retptrs : Vec :: new ( ) ,
1048- } ;
1039+ let mut ret = Return :: default ( ) ;
10491040 match func. results . len ( ) {
10501041 0 => ret. scalar = Some ( Scalar :: Void ) ,
10511042 1 => {
10521043 let ty = func. results . iter_types ( ) . next ( ) . unwrap ( ) ;
10531044 ret. return_single ( self . resolve , ty, ty) ;
10541045 }
10551046 _ => {
1056- ret. return_multiple = true ;
10571047 ret. retptrs . extend ( func. results . iter_types ( ) . cloned ( ) ) ;
10581048 }
10591049 }
You can’t perform that action at this time.
0 commit comments