Skip to content

Commit

Permalink
fix(spa): changes (revert for wp 0.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcnmx committed Jun 5, 2024
1 parent 3c74eef commit 0a32bf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ trust_return_value_nullability = true
pattern = "(.*valist|new_array|new_object|object_get|parse_array|parse_object)"
ignore = true
[[object.function]]
pattern = "(new_wrap|new_from_string|new_wrap_string|new_wrap_stringn|get_spa_json|get_data)"
pattern = "(new_wrap|new_from_string|get_spa_json|get_data)"
manual = true
[[object.function]]
name = "new_from_stringn"
Expand Down
7 changes: 3 additions & 4 deletions src/spa/json/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ mod serde_impl {
let mut parser = if self.is_array() {
SpaJsonParser::new_array(&self)
} else {
SpaJsonParser::new_undefined(&self)
return Err(error_expected(self, SpaType::ARRAY))
};
let res = visitor.visit_seq(&mut parser)?;
parse_end(parser).map(|()| res)
Expand All @@ -445,7 +445,7 @@ mod serde_impl {
let mut parser = if self.is_object() {
SpaJsonParser::new_object(&self)
} else {
SpaJsonParser::new_undefined(&self)
return Err(error_expected(self, SpaType::OBJECT))
};
let res = visitor.visit_map(&mut parser)?;
parse_end(parser).map(|()| res)
Expand All @@ -468,12 +468,11 @@ mod serde_impl {
) -> Result<V::Value, Self::Error> {
let mut parser = match peek_type(self)? {
SpaType::OBJECT => SpaJsonParser::new_object(&self),
found @ SpaType::ARRAY =>
found =>
return Err(ParseError::TypeMismatch {
expected: SpaType::CHOICE,
found: Some(found),
}),
_ => SpaJsonParser::new_undefined(&self),
};
let res = visitor.visit_enum(&mut parser)?;
parse_end(parser).map(|()| res)
Expand Down

0 comments on commit 0a32bf1

Please sign in to comment.