Skip to content

Commit

Permalink
style: format source
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Sørensen <[email protected]>
  • Loading branch information
cafkafk committed Dec 21, 2024
1 parent d872d38 commit 981da84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ impl<'de> Deserializer<'de> {
}

let mut loader = Loader::new(self.progress)?;
let Some(document) = loader.next_document() else { return Err(error::new(ErrorImpl::EndOfStream)) };
let Some(document) = loader.next_document() else {
return Err(error::new(ErrorImpl::EndOfStream));
};
let t = f(&mut DeserializerFromEvents {
document: &document,
pos: &mut pos,
Expand Down Expand Up @@ -857,11 +859,11 @@ where
V: Visitor<'de>,
{
let Ok(v) = str::from_utf8(&scalar.value) else {
return Err(de::Error::invalid_type(
Unexpected::Bytes(&scalar.value),
&visitor,
))
};
return Err(de::Error::invalid_type(
Unexpected::Bytes(&scalar.value),
&visitor,
));
};
if let (Some(tag), false) = (&scalar.tag, tagged_already) {
if tag == Tag::BOOL {
return match parse_bool(v) {
Expand Down
4 changes: 3 additions & 1 deletion src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ impl<'input> Loader<'input> {
}

pub fn next_document(&mut self) -> Option<Document<'input>> {
let Some(parser) = &mut self.parser else { return None };
let Some(parser) = &mut self.parser else {
return None;
};

let first = self.document_count == 0;
self.document_count += 1;
Expand Down

0 comments on commit 981da84

Please sign in to comment.