mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 22:41:24 +00:00
Do only use ConstructorToken when needed
Also removing some effectively dead code
This commit is contained in:
@ -203,7 +203,7 @@ impl Program {
|
||||
panic!("can only bindgen safe functions");
|
||||
}
|
||||
|
||||
let mut opts = BindgenAttrs::find(&mut method.attrs);
|
||||
let opts = BindgenAttrs::find(&mut method.attrs);
|
||||
let is_constructor = opts.constructor();
|
||||
let constructor = if is_constructor {
|
||||
Some(method.sig.ident.to_string())
|
||||
@ -211,16 +211,6 @@ impl Program {
|
||||
None
|
||||
};
|
||||
|
||||
if is_constructor {
|
||||
let pos = opts.attrs
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|(_, a)| **a == BindgenAttr::Constructor)
|
||||
.unwrap()
|
||||
.0;
|
||||
opts.attrs.remove(pos);
|
||||
}
|
||||
|
||||
let (function, mutable) = Function::from_decl(
|
||||
method.sig.ident,
|
||||
Box::new(method.sig.decl.clone()),
|
||||
|
Reference in New Issue
Block a user