fn json_primitive(&mut self) -> Result<Option<JsonValue>, Error> {
        if let Some(string) = self.consume_string_literal()? {
            Ok(Some(JsonValue::String(string)))
        }
        // The else is needed becaue of https://github.com/rust-lang/rust/issues/37510
        else {
            if self.consume("true") {
                Ok(Some(JsonValue::True))
            } else if self.consume("false") {
                Ok(Some(JsonValue::False))
            } else if self.consume("null") {
                Ok(Some(JsonValue::Null))
            } else if let Some(num) = self.consume_number()? {
                Ok(Some(JsonValue::Number(num)))
            } else if let Some(json) = self.consume_param()? {
                Ok(Some(json))
            } else {
                Ok(None)
            }
        }
    }
/// JSON primites are strings, numbers, booleans and null
JSON primites are strings, numbers, booleans and null
JSON primites are strings numbers booleans and null
fn json_primitive(&mut self) -> Result<Option<JsonValue>, Error> {
        if let Some(string) = self.consume_string_literal()? {
            Ok(Some(JsonValue::String(string)))
        }
        // The else is needed becaue of https://github.com/rust-lang/rust/issues/37510
        else {
            if self.consume("true") {
                Ok(Some(JsonValue::True))
            } else if self.consume("false") {
                Ok(Some(JsonValue::False))
            } else if self.consume("null") {
                Ok(Some(JsonValue::Null))
            } else if let Some(num) = self.consume_number()? {
                Ok(Some(JsonValue::Number(num)))
            } else if let Some(json) = self.consume_param()? {
                Ok(Some(json))
            } else {
                Ok(None)
            }
        }
    }
fn json_primitive ( & mut self ) -> Result < Option < JsonValue > , Error > { if let Some ( string ) = self . consume_string_literal ( ) ? { Ok ( Some ( JsonValue :: String ( string ) ) ) } // The else is needed becaue of https://github.com/rust-lang/rust/issues/37510 else { if self . consume ( " " ) { Ok ( Some ( JsonValue :: True ) ) } else if self . consume ( " " ) { Ok ( Some ( JsonValue :: False ) ) } else if self . consume ( " " ) { Ok ( Some ( JsonValue :: Null ) ) } else if let Some ( num ) = self . consume_number ( ) ? { Ok ( Some ( JsonValue :: Number ( num ) ) ) } else if let Some ( json ) = self . consume_param ( ) ? { Ok ( Some ( json ) ) } else { Ok ( None ) } } }
JSON primites are strings, numbers, booleans and null
JSON primites are strings numbers booleans and null
&mut self
&mut self