pub fn select_function(&mut self, idx: Option<usize>) -> BuildResult<()> {
        match idx {
            Some(idx) => {
                if idx < self.module.functions.len() {
                    self.selected_function = Some(idx);
                    Ok(())
                } else {
                    Err(Error::FunctionNotFound)
                }
            }
            None => {
                // make sure to unselect block too
                self.selected_block = None;
                self.selected_function = None;
                Ok(())
            }
        }
    }
/// Select a function to insert instructions into by index (indexed into self.module.functions), or unselect if None
Select a function to insert instructions into by index (indexed into self.module.functions), or unselect if None
Select a function to insert instructions into by index ( indexed into self . module . functions ) or unselect if None
pub fn select_function(&mut self, idx: Option<usize>) -> BuildResult<()> {
        match idx {
            Some(idx) => {
                if idx < self.module.functions.len() {
                    self.selected_function = Some(idx);
                    Ok(())
                } else {
                    Err(Error::FunctionNotFound)
                }
            }
            None => {
                // make sure to unselect block too
                self.selected_block = None;
                self.selected_function = None;
                Ok(())
            }
        }
    }
pub fn select_function ( & mut self , idx : Option < usize > ) -> BuildResult < ( ) > { match idx { Some ( idx ) => { if idx < self . module . functions . len ( ) { self . selected_function = Some ( idx ) ; Ok ( ( ) ) } else { Err ( Error :: FunctionNotFound ) } } None => { // make sure to unselect block too self . selected_block = None ; self . selected_function = None ; Ok ( ( ) ) } } }
Select a function to insert instructions into by index (indexed into self.module.functions), or unselect if None
Select a function to insert instructions into by index ( indexed into self . module . functions ) or unselect if None
&mut self
idx
Option<usize>
&mut self
idx
Option<usize>