fn deserialize_unit_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
    where
        V: Visitor<'de>,
    {
        self.skip_whitespace()?;
        let identifier = self.parse_identifier()?;
        if identifier != name {
            return Err(self.error(ErrorCode::WrongStructName(
                name.to_string(),
                identifier.to_string(),
            )));
        }

        self.skip_whitespace()?;
        // Checks for optional {}, ignoring EOF
        let has_brace = self.peek_char().or_else(|e| {
            if e.code == ErrorCode::UnexpectedEof {
                Ok('\n')
            } else {
                Err(e)
            }
        })? == '{';
        if has_brace {
            self.next_char()?;
            self.skip_whitespace()?;
            match self.peek_char()? {
                '}' => self.next_char()?,
                c => return Err(self.error(ErrorCode::ExpectedStructEnd(c))),
            };
        }

        visitor.visit_unit()
    }
/// Unit struct are named values containing no data.
Unit struct are named values containing no data.
Unit struct are named values containing no data .
fn deserialize_unit_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
    where
        V: Visitor<'de>,
    {
        self.skip_whitespace()?;
        let identifier = self.parse_identifier()?;
        if identifier != name {
            return Err(self.error(ErrorCode::WrongStructName(
                name.to_string(),
                identifier.to_string(),
            )));
        }
        self.skip_whitespace()?;
        // Checks for optional {}, ignoring EOF
        let has_brace = self.peek_char().or_else(|e| {
            if e.code == ErrorCode::UnexpectedEof {
                Ok('\n')
            } else {
                Err(e)
            }
        })? == '{';
        if has_brace {
            self.next_char()?;
            self.skip_whitespace()?;
            match self.peek_char()? {
                '}' => self.next_char()?,
                c => return Err(self.error(ErrorCode::ExpectedStructEnd(c))),
            };
        }
        visitor.visit_unit()
    }
fn deserialize_unit_struct < V > ( self , name : & ' static str , visitor : V ) -> Result < V :: Value > where V : Visitor < ' de > , { self . skip_whitespace ( ) ? ; let identifier = self . parse_identifier ( ) ? ; if identifier != name { return Err ( self . error ( ErrorCode :: WrongStructName ( name . to_string ( ) , identifier . to_string ( ) , ) ) ) ; } self . skip_whitespace ( ) ? ; // Checks for optional {}, ignoring EOF let has_brace = self . peek_char ( ) . or_else ( | e | { if e . code == ErrorCode :: UnexpectedEof { Ok ( '\n' ) } else { Err ( e ) } } ) ? == '{' ; if has_brace { self . next_char ( ) ? ; self . skip_whitespace ( ) ? ; match self . peek_char ( ) ? { '}' => self . next_char ( ) ? , c => return Err ( self . error ( ErrorCode :: ExpectedStructEnd ( c ) ) ) , } ; } visitor . visit_unit ( ) }
Unit struct are named values containing no data.
Unit struct are named values containing no data .
self
name
&'static str
visitor
V
self
name
&'static str
visitor
V