fn decode_gradient_op(chr: char, gradient_id: DecodeGradientId) -> Result<(DecoderState, Option<Draw>), DecoderError> {
        use PartialResult::*;

        // Decode the texture ID first
        let gradient_id = match gradient_id {
            MatchMore(gradient_id) => { 
                let gradient_id = Self::decode_gradient_id(chr, gradient_id)?;
                return Ok((DecoderState::GradientOp(gradient_id), None));
            }

            FullMatch(gradient_id) => gradient_id
        };

        // The gradient op is indicated by the next character
        match chr {
            'N' => Ok((DecoderState::GradientOpNew(gradient_id, String::new()), None)),
            'S' => Ok((DecoderState::GradientOpAddStop(gradient_id, String::new()), None)),

            _   => Err(DecoderError::InvalidCharacter(chr))
        }
    }
///
/// Decodes a gradient ID and determines which gradient operation is being performed on it
///
Decodes a gradient ID and determines which gradient operation is being performed on it
Decodes a gradient ID and determines which gradient operation is being performed on it
fn decode_gradient_op(chr: char, gradient_id: DecodeGradientId) -> Result<(DecoderState, Option<Draw>), DecoderError> {
        use PartialResult::*;
        // Decode the texture ID first
        let gradient_id = match gradient_id {
            MatchMore(gradient_id) => { 
                let gradient_id = Self::decode_gradient_id(chr, gradient_id)?;
                return Ok((DecoderState::GradientOp(gradient_id), None));
            }
            FullMatch(gradient_id) => gradient_id
        };
        // The gradient op is indicated by the next character
        match chr {
            'N' => Ok((DecoderState::GradientOpNew(gradient_id, String::new()), None)),
            'S' => Ok((DecoderState::GradientOpAddStop(gradient_id, String::new()), None)),
            _   => Err(DecoderError::InvalidCharacter(chr))
        }
    }
fn decode_gradient_op ( chr : char , gradient_id : DecodeGradientId ) -> Result < ( DecoderState , Option < Draw > ) , DecoderError > { use PartialResult :: * ; // Decode the texture ID first let gradient_id = match gradient_id { MatchMore ( gradient_id ) => { let gradient_id = Self :: decode_gradient_id ( chr , gradient_id ) ? ; return Ok ( ( DecoderState :: GradientOp ( gradient_id ) , None ) ) ; } FullMatch ( gradient_id ) => gradient_id } ; // The gradient op is indicated by the next character match chr { 'N' => Ok ( ( DecoderState :: GradientOpNew ( gradient_id , String :: new ( ) ) , None ) ) , 'S' => Ok ( ( DecoderState :: GradientOpAddStop ( gradient_id , String :: new ( ) ) , None ) ) , _ => Err ( DecoderError :: InvalidCharacter ( chr ) ) } }
Decodes a gradient ID and determines which gradient operation is being performed on it
Decodes a gradient ID and determines which gradient operation is being performed on it
chr
char
gradient_id
DecodeGradientId