pub fn handle_next(&mut self, search_type: PatternSearchType<T>) -> crate::Result<T> {
        match search_type {
            PatternSearchType::NonMatch(byte) => Ok(byte),
            PatternSearchType::Match { data, index: _ } => match self.pattern.replace(data) {
                Ok(mut item) => {
                    let byte = item.remove(0);
                    self.data.set(item);
                    Ok(byte)
                }
                Err(error) => Err(error),
            },
        }
    }
// Handles PatternSearchType by returning a single byte or an error that
// happened in the replace process
Handles PatternSearchType by returning a single byte or an error that
happened in the replace process
Handles PatternSearchType by returning a single byte or an error that happened in the replace process
pub fn handle_next(&mut self, search_type: PatternSearchType<T>) -> crate::Result<T> {
        match search_type {
            PatternSearchType::NonMatch(byte) => Ok(byte),
            PatternSearchType::Match { data, index: _ } => match self.pattern.replace(data) {
                Ok(mut item) => {
                    let byte = item.remove(0);
                    self.data.set(item);
                    Ok(byte)
                }
                Err(error) => Err(error),
            },
        }
    }
pub fn handle_next ( & mut self , search_type : PatternSearchType < T > ) -> crate :: Result < T > { match search_type { PatternSearchType :: NonMatch ( byte ) => Ok ( byte ) , PatternSearchType :: Match { data , index : _ } => match self . pattern . replace ( data ) { Ok ( mut item ) => { let byte = item . remove ( 0 ) ; self . data . set ( item ) ; Ok ( byte ) } Err ( error ) => Err ( error ) , } , } }
Handles PatternSearchType by returning a single byte or an error that
happened in the replace process
Handles PatternSearchType by returning a single byte or an error that happened in the replace process
&mut self
search_type
PatternSearchType<T>