///
/// Takes a function definition and generates a C function def from it
///
/// For example: "self, test, bar"
///
Takes a function definition and generates a C function def from it
For example: "self, test, bar"
Takes a function definition and generates a C function def from it For example : " self test bar "
pub fn generate_invoke(&self, replace_first_arg: FirstArgName) -> String {
        let mut function_invoke = String::with_capacity(128);
        let len = self.function_args.len();
        // write arguments
        for (i, arg) in self.function_args.iter().enumerate() {
            if i == 0 {
                match replace_first_arg {
                    //FirstArgName::Keep => function_invoke.push_str(&arg.name),
                    FirstArgName::Remove => continue,
                    //FirstArgName::Event(ref name) => function_invoke.push_str(name),
                }
            } else {
                function_invoke.push_str(&arg.name);
            }
            if i != len - 1 {
                function_invoke.push_str(", ");
            }
        }
        function_invoke
    }
pub fn generate_invoke ( & self , replace_first_arg : FirstArgName ) -> String { let mut function_invoke = String :: with_capacity ( 128 ) ; let len = self . function_args . len ( ) ; // write arguments for ( i , arg ) in self . function_args . iter ( ) . enumerate ( ) { if i == 0 { match replace_first_arg { //FirstArgName::Keep => function_invoke.push_str(&arg.name), FirstArgName :: Remove => continue , //FirstArgName::Event(ref name) => function_invoke.push_str(name), } } else { function_invoke . push_str ( & arg . name ) ; } if i != len - 1 { function_invoke . push_str ( " " ) ; } } function_invoke }
Takes a function definition and generates a C function def from it
For example: "self, test, bar"
Takes a function definition and generates a C function def from it For example : " self test bar "
&self
replace_first_arg
FirstArgName