pub fn map_key(&mut self) -> Result<Pos, crate::Error> {
        let mut curr = self.inner.current_mut();

        // The current slot must:
        // - be a fresh map (with no key or value) or
        // - be a map with a done value

        match curr.0 {
            Slot::MAP_DONE | Slot::MAP_VAL_DONE => {
                curr.0 = Slot::MAP_KEY;

                Ok(curr.pos(self.inner.depth()))
            }
            _ => Err(crate::Error::custom(expecting!(*curr, "map key"))),
        }
    }
/**
    Begin a map key.

    The key will be implicitly completed by the value
    that follows it.
    */
Begin a map key.
The key will be implicitly completed by the value
that follows it.
Begin a map key . The key will be implicitly completed by the value that follows it .
pub fn map_key(&mut self) -> Result<Pos, crate::Error> {
        let mut curr = self.inner.current_mut();
        // The current slot must:
        // - be a fresh map (with no key or value) or
        // - be a map with a done value
        match curr.0 {
            Slot::MAP_DONE | Slot::MAP_VAL_DONE => {
                curr.0 = Slot::MAP_KEY;
                Ok(curr.pos(self.inner.depth()))
            }
            _ => Err(crate::Error::custom(expecting!(*curr, "map key"))),
        }
    }
pub fn map_key ( & mut self ) -> Result < Pos , crate :: Error > { let mut curr = self . inner . current_mut ( ) ; // The current slot must: // - be a fresh map (with no key or value) or // - be a map with a done value match curr . 0 { Slot :: MAP_DONE | Slot :: MAP_VAL_DONE => { curr . 0 = Slot :: MAP_KEY ; Ok ( curr . pos ( self . inner . depth ( ) ) ) } _ => Err ( crate :: Error :: custom ( expecting ! ( curr " " ) ) ) , } }
Begin a map key.
Begin a map key .
&mut self