Don't error on ignored (direct) scalar nodes

This commit is contained in:
Dirkjan Ochtman 2022-12-13 16:46:09 +01:00
parent aa45a74bb4
commit 88c52e98d2
1 changed files with 6 additions and 0 deletions

View File

@ -241,6 +241,12 @@ fn deserialize_struct(
} }
} }
if direct.is_empty() {
direct.extend(quote!(Node::Text(_) => {
// no direct field, ignore
}));
}
// Elements // Elements
let elements_enum = elements_tokens.r#enum; let elements_enum = elements_tokens.r#enum;
let mut elements_branches = elements_tokens.branches; let mut elements_branches = elements_tokens.branches;