fn maybe_set_tick_labels(&self) {
        // Show x ticks if they are available
        if self.x_tick_positions.is_some() && !self.x_tick_positions.as_ref().unwrap().is_empty() {
            let mut pointer_vec; // The vector of pointers we create has to have a longer lifetime
            let labels_pointer = if let Some(labels_value) = &self.x_tick_labels {
                pointer_vec = labels_value
                    .iter()
                    .map(|x| x.as_ptr() as *const c_char)
                    .collect::<Vec<*const c_char>>();
                pointer_vec.as_mut_ptr()
            } else {
                std::ptr::null_mut()
            };

            unsafe {
                sys::ImPlot_SetNextPlotTicksXdoublePtr(
                    self.x_tick_positions.as_ref().unwrap().as_ptr(),
                    self.x_tick_positions.as_ref().unwrap().len() as i32,
                    labels_pointer,
                    self.show_x_default_ticks,
                )
            }
        }

        self.y_tick_positions
            .iter()
            .zip(self.y_tick_labels.iter())
            .zip(self.show_y_default_ticks.iter())
            .enumerate()
            .for_each(|(k, ((positions, labels), show_defaults))| {
                if positions.is_some() && !positions.as_ref().unwrap().is_empty() {
                    // The vector of pointers we create has to have a longer lifetime
                    let mut pointer_vec;
                    let labels_pointer = if let Some(labels_value) = &labels {
                        pointer_vec = labels_value
                            .iter()
                            .map(|x| x.as_ptr() as *const c_char)
                            .collect::<Vec<*const c_char>>();
                        pointer_vec.as_mut_ptr()
                    } else {
                        std::ptr::null_mut()
                    };

                    unsafe {
                        sys::ImPlot_SetNextPlotTicksYdoublePtr(
                            positions.as_ref().unwrap().as_ptr(),
                            positions.as_ref().unwrap().len() as i32,
                            labels_pointer,
                            *show_defaults,
                            k as i32,
                        )
                    }
                }
            });
    }
/// Internal helper function to set tick labels in case they are specified. This does the
/// preparation work that is the same for both the X and Y axis plots, then calls the
/// "set next plot ticks" wrapper functions for both X and Y.
Internal helper function to set tick labels in case they are specified. This does the
preparation work that is the same for both the X and Y axis plots, then calls the
"set next plot ticks" wrapper functions for both X and Y.
Internal helper function to set tick labels in case they are specified . This does the preparation work that is the same for both the X and Y axis plots then calls the " set next plot ticks " wrapper functions for both X and Y .
fn maybe_set_tick_labels(&self) {
        // Show x ticks if they are available
        if self.x_tick_positions.is_some() && !self.x_tick_positions.as_ref().unwrap().is_empty() {
            let mut pointer_vec; // The vector of pointers we create has to have a longer lifetime
            let labels_pointer = if let Some(labels_value) = &self.x_tick_labels {
                pointer_vec = labels_value
                    .iter()
                    .map(|x| x.as_ptr() as *const c_char)
                    .collect::<Vec<*const c_char>>();
                pointer_vec.as_mut_ptr()
            } else {
                std::ptr::null_mut()
            };
            unsafe {
                sys::ImPlot_SetNextPlotTicksXdoublePtr(
                    self.x_tick_positions.as_ref().unwrap().as_ptr(),
                    self.x_tick_positions.as_ref().unwrap().len() as i32,
                    labels_pointer,
                    self.show_x_default_ticks,
                )
            }
        }
        self.y_tick_positions
            .iter()
            .zip(self.y_tick_labels.iter())
            .zip(self.show_y_default_ticks.iter())
            .enumerate()
            .for_each(|(k, ((positions, labels), show_defaults))| {
                if positions.is_some() && !positions.as_ref().unwrap().is_empty() {
                    // The vector of pointers we create has to have a longer lifetime
                    let mut pointer_vec;
                    let labels_pointer = if let Some(labels_value) = &labels {
                        pointer_vec = labels_value
                            .iter()
                            .map(|x| x.as_ptr() as *const c_char)
                            .collect::<Vec<*const c_char>>();
                        pointer_vec.as_mut_ptr()
                    } else {
                        std::ptr::null_mut()
                    };
                    unsafe {
                        sys::ImPlot_SetNextPlotTicksYdoublePtr(
                            positions.as_ref().unwrap().as_ptr(),
                            positions.as_ref().unwrap().len() as i32,
                            labels_pointer,
                            *show_defaults,
                            k as i32,
                        )
                    }
                }
            });
    }
fn maybe_set_tick_labels ( & self ) { // Show x ticks if they are available if self . x_tick_positions . is_some ( ) && ! self . x_tick_positions . as_ref ( ) . unwrap ( ) . is_empty ( ) { let mut pointer_vec ; // The vector of pointers we create has to have a longer lifetime let labels_pointer = if let Some ( labels_value ) = & self . x_tick_labels { pointer_vec = labels_value . iter ( ) . map ( | x | x . as_ptr ( ) as * const c_char ) . collect :: < Vec < * const c_char > > ( ) ; pointer_vec . as_mut_ptr ( ) } else { std :: ptr :: null_mut ( ) } ; unsafe { sys :: ImPlot_SetNextPlotTicksXdoublePtr ( self . x_tick_positions . as_ref ( ) . unwrap ( ) . as_ptr ( ) , self . x_tick_positions . as_ref ( ) . unwrap ( ) . len ( ) as i32 , labels_pointer , self . show_x_default_ticks , ) } } self . y_tick_positions . iter ( ) . zip ( self . y_tick_labels . iter ( ) ) . zip ( self . show_y_default_ticks . iter ( ) ) . enumerate ( ) . for_each ( | ( k , ( ( positions , labels ) , show_defaults ) ) | { if positions . is_some ( ) && ! positions . as_ref ( ) . unwrap ( ) . is_empty ( ) { // The vector of pointers we create has to have a longer lifetime let mut pointer_vec ; let labels_pointer = if let Some ( labels_value ) = & labels { pointer_vec = labels_value . iter ( ) . map ( | x | x . as_ptr ( ) as * const c_char ) . collect :: < Vec < * const c_char > > ( ) ; pointer_vec . as_mut_ptr ( ) } else { std :: ptr :: null_mut ( ) } ; unsafe { sys :: ImPlot_SetNextPlotTicksYdoublePtr ( positions . as_ref ( ) . unwrap ( ) . as_ptr ( ) , positions . as_ref ( ) . unwrap ( ) . len ( ) as i32 , labels_pointer , * show_defaults , k as i32 , ) } } } ) ; }
Internal helper function to set tick labels in case they are specified.
Internal helper function to set tick labels in case they are specified .
&self
&self