Improve error for unexpected nodes

This commit is contained in:
Dirkjan Ochtman 2022-12-13 14:14:21 +01:00
parent e186684824
commit aa45a74bb4
1 changed files with 2 additions and 1 deletions

View File

@ -260,6 +260,7 @@ fn deserialize_struct(
}); });
let ident = &input.ident; let ident = &input.ident;
let ident_str = format!("{ident}");
let name = container_meta.tag(); let name = container_meta.tag();
let default_namespace = container_meta.default_namespace(); let default_namespace = container_meta.default_namespace();
let generics = container_meta.xml_generics(borrowed); let generics = container_meta.xml_generics(borrowed);
@ -321,7 +322,7 @@ fn deserialize_struct(
} }
} }
#direct #direct
node => return Err(Error::UnexpectedNode(format!("{:?}", node))), node => return Err(Error::UnexpectedNode(format!("{:?} in {}", node, #ident_str))),
} }
} }