Skip to content

Commit

Permalink
null parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Apr 6, 2024
1 parent 63421f4 commit 9b07888
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,13 @@ impl<'de, 'a, R: Read> de::Deserializer<'de> for &'a mut Deserializer<R> {
todo!()
}

fn deserialize_unit<V>(self, _visitor: V) -> Result<V::Value>
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
todo!()
let header = self.read_header()?;
self.read_null(header)?;
visitor.visit_unit()
}

fn deserialize_unit_struct<V>(
Expand Down Expand Up @@ -555,4 +557,9 @@ mod tests {
-9223372036854775808
);
}

#[test]
fn test_null() {
from_bytes::<()>(b"\x00").unwrap();
}
}
2 changes: 1 addition & 1 deletion src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) fn parse_json5<I, T>(_input: I) -> crate::Result<T> {
pub(crate) type Json5Error = serde_json5::Error;
#[cfg(not(feature = "serde_json5"))]
#[derive(Debug)]
pub(crate) struct Json5Error;
pub struct Json5Error;

#[cfg(not(feature = "serde_json5"))]
impl std::fmt::Display for Json5Error {
Expand Down

0 comments on commit 9b07888

Please sign in to comment.