pub fn consume_byte(&mut self, c: u8) -> Result<()> {
        if self.curr_byte()? != c {
            return Err(
                Error::InvalidChar(
                    vec![self.curr_byte_unchecked(), c],
                    self.calc_char_pos(),
                )
            );
        }

        self.advance(1);
        Ok(())
    }
/// Consumes current byte if it's equal to the provided byte.
///
/// # Errors
///
/// - `InvalidChar`
/// - `UnexpectedEndOfStream`
///
/// # Examples
///
/// ```
/// use svgtypes::Stream;
///
/// let mut s = Stream::from("Some text.");
/// s.consume_byte(b'S').unwrap();
/// s.consume_byte(b'o').unwrap();
/// s.consume_byte(b'm').unwrap();
/// // s.consume_byte(b'q').unwrap(); // will produce an error
/// ```
Consumes current byte if it's equal to the provided byte.
Consumes current byte if it ' s equal to the provided byte .
pub fn consume_byte(&mut self, c: u8) -> Result<()> {
        if self.curr_byte()? != c {
            return Err(
                Error::InvalidChar(
                    vec![self.curr_byte_unchecked(), c],
                    self.calc_char_pos(),
                )
            );
        }
        self.advance(1);
        Ok(())
    }
pub fn consume_byte ( & mut self , c : u8 ) -> Result < ( ) > { if self . curr_byte ( ) ? != c { return Err ( Error :: InvalidChar ( vec ! [ self curr_byte_unchecked ( ) c ] , self . calc_char_pos ( ) , ) ) ; } self . advance ( 1 ) ; Ok ( ( ) ) }
Consumes current byte if it's equal to the provided byte.
Consumes current byte if it ' s equal to the provided byte .
&mut self
c
u8
errors
None
examples
```
use svgtypes::Stream.

let mut s = Stream::from("Some text.");
s.consume_byte(b'S').unwrap();
s.consume_byte(b'o').unwrap();
s.consume_byte(b'm').unwrap();
s.consume_byte(b'q').unwrap(); // will produce an error
```
` ` ` use svgtypes :: Stream . let mut s = Stream :: from ( " Some text . " ) ; s . consume_byte ( b ' S ' ) . unwrap () ; s . consume_byte ( b ' o ' ) . unwrap () ; s . consume_byte ( b ' m ' ) . unwrap () ; s . consume_byte ( b ' q ' ) . unwrap () ; // will produce an error ` ` `