Skip to content

Commit

Permalink
revert null deserialization & format code
Browse files Browse the repository at this point in the history
  • Loading branch information
emonadeo committed Oct 19, 2024
1 parent 3d723a1 commit f37029b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ciborium/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ where

Header::Simple(simple::FALSE) => self.deserialize_bool(visitor),
Header::Simple(simple::TRUE) => self.deserialize_bool(visitor),
Header::Simple(simple::NULL) => visitor.visit_none(),
Header::Simple(simple::NULL) => self.deserialize_option(visitor),
Header::Simple(_) => self.recurse(|me| {
let mut simple_de =
crate::simple::SimpleDeserializer::<_, Self>::new(&mut me.decoder);
Expand Down
3 changes: 2 additions & 1 deletion ciborium/src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ where
#[inline]
fn deserialize_any<V: de::Visitor<'de>>(self, visitor: V) -> Result<V::Value, Self::Error> {
let offset = self.decoder.offset();
let Header::Simple(simple) = self.decoder.pull()? else{

let Header::Simple(simple) = self.decoder.pull()? else {
return Err(crate::de::Error::semantic(offset, "expected simple"));
};
visitor.visit_u8(simple)
Expand Down

0 comments on commit f37029b

Please sign in to comment.