From 833ef068c62f4a20c039ffbc1c7c451b8a7756ad Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 27 Aug 2017 01:21:07 +0100 Subject: [PATCH] message: Fix wrong element for xml:lang. --- src/message.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/message.rs b/src/message.rs index 3a4795b1..add6d173 100644 --- a/src/message.rs +++ b/src/message.rs @@ -168,7 +168,7 @@ impl TryFrom for Message { for _ in elem.children() { return Err(Error::ParseError("Unknown child in body element.")); } - let lang = get_attr!(root, "xml:lang", default); + let lang = get_attr!(elem, "xml:lang", default); let body = Body(elem.text()); if bodies.insert(lang, body).is_some() { return Err(Error::ParseError("Body element present twice for the same xml:lang.")); @@ -177,7 +177,7 @@ impl TryFrom for Message { for _ in elem.children() { return Err(Error::ParseError("Unknown child in subject element.")); } - let lang = get_attr!(root, "xml:lang", default); + let lang = get_attr!(elem, "xml:lang", default); let subject = Subject(elem.text()); if subjects.insert(lang, subject).is_some() { return Err(Error::ParseError("Subject element present twice for the same xml:lang."));