@@ -76,25 +76,19 @@ pub struct Module {
76
76
impl From < ModuleBuilder < ' _ > > for Module {
77
77
fn from ( builder : ModuleBuilder ) -> Self {
78
78
let functions = builder. functions ;
79
-
80
- #[ allow( unused_mut) ]
81
- let mut classes = builder
82
- . classes
83
- . into_iter ( )
84
- . map ( |c| c ( ) . into ( ) )
85
- . collect :: < StdVec < _ > > ( ) ;
86
-
87
- #[ cfg( feature = "closure" ) ]
88
- classes. push ( Class :: closure ( ) ) ;
89
-
90
79
Self {
91
80
name : builder. name . into ( ) ,
92
81
functions : functions
93
82
. into_iter ( )
94
83
. map ( Function :: from)
95
84
. collect :: < StdVec < _ > > ( )
96
85
. into ( ) ,
97
- classes : classes. into ( ) ,
86
+ classes : builder
87
+ . classes
88
+ . into_iter ( )
89
+ . map ( |c| c ( ) . into ( ) )
90
+ . collect :: < StdVec < _ > > ( )
91
+ . into ( ) ,
98
92
constants : builder
99
93
. constants
100
94
. into_iter ( )
@@ -157,8 +151,6 @@ pub struct Parameter {
157
151
pub ty : Option < DataType > ,
158
152
/// Whether the parameter is nullable.
159
153
pub nullable : bool ,
160
- /// Whether the parameter is variadic.
161
- pub variadic : bool ,
162
154
/// Default value of the parameter.
163
155
pub default : Option < RString > ,
164
156
}
@@ -183,43 +175,6 @@ pub struct Class {
183
175
pub constants : Vec < Constant > ,
184
176
}
185
177
186
- #[ cfg( feature = "closure" ) ]
187
- impl Class {
188
- /// Creates a new class representing a Rust closure used for generating
189
- /// the stubs if the `closure` feature is enabled.
190
- #[ must_use]
191
- pub fn closure ( ) -> Self {
192
- Self {
193
- name : "RustClosure" . into ( ) ,
194
- docs : DocBlock ( StdVec :: new ( ) . into ( ) ) ,
195
- extends : Option :: None ,
196
- implements : StdVec :: new ( ) . into ( ) ,
197
- properties : StdVec :: new ( ) . into ( ) ,
198
- methods : vec ! [ Method {
199
- name: "__invoke" . into( ) ,
200
- docs: DocBlock ( StdVec :: new( ) . into( ) ) ,
201
- ty: MethodType :: Member ,
202
- params: vec![ Parameter {
203
- name: "args" . into( ) ,
204
- ty: Option :: Some ( DataType :: Mixed ) ,
205
- nullable: false ,
206
- variadic: true ,
207
- default : Option :: None ,
208
- } ]
209
- . into( ) ,
210
- retval: Option :: Some ( Retval {
211
- ty: DataType :: Mixed ,
212
- nullable: false ,
213
- } ) ,
214
- r#static: false ,
215
- visibility: Visibility :: Public ,
216
- } ]
217
- . into ( ) ,
218
- constants : StdVec :: new ( ) . into ( ) ,
219
- }
220
- }
221
- }
222
-
223
178
impl From < ClassBuilder > for Class {
224
179
fn from ( val : ClassBuilder ) -> Self {
225
180
Self {
@@ -471,8 +426,6 @@ impl From<(String, Box<dyn IntoConst + Send>, DocComments)> for Constant {
471
426
#[ cfg( test) ]
472
427
mod tests {
473
428
#![ cfg_attr( windows, feature( abi_vectorcall) ) ]
474
- use cfg_if:: cfg_if;
475
-
476
429
use super :: * ;
477
430
478
431
use crate :: { args:: Arg , test:: test_function} ;
@@ -507,13 +460,7 @@ mod tests {
507
460
let module: Module = builder. into ( ) ;
508
461
assert_eq ! ( module. name, "test" . into( ) ) ;
509
462
assert_eq ! ( module. functions. len( ) , 1 ) ;
510
- cfg_if ! {
511
- if #[ cfg( feature = "closure" ) ] {
512
- assert_eq!( module. classes. len( ) , 1 ) ;
513
- } else {
514
- assert_eq!( module. classes. len( ) , 0 ) ;
515
- }
516
- }
463
+ assert_eq ! ( module. classes. len( ) , 0 ) ;
517
464
assert_eq ! ( module. constants. len( ) , 0 ) ;
518
465
}
519
466
@@ -532,7 +479,6 @@ mod tests {
532
479
name: "foo" . into( ) ,
533
480
ty: Option :: Some ( DataType :: Long ) ,
534
481
nullable: false ,
535
- variadic: false ,
536
482
default : Option :: None ,
537
483
} ]
538
484
. into( )
@@ -622,7 +568,6 @@ mod tests {
622
568
name: "foo" . into( ) ,
623
569
ty: Option :: Some ( DataType :: Long ) ,
624
570
nullable: false ,
625
- variadic: false ,
626
571
default : Option :: None ,
627
572
} ]
628
573
. into( )
0 commit comments