Don't fabricate empty string in error case
This commit is contained in:
parent
cd7e3b4224
commit
f6a9d66288
|
@ -1,8 +1,9 @@
|
||||||
use std::collections::{BTreeMap, VecDeque};
|
use std::collections::{BTreeMap, VecDeque};
|
||||||
|
|
||||||
use super::{Error, Id};
|
|
||||||
use xmlparser::{ElementEnd, Token, Tokenizer};
|
use xmlparser::{ElementEnd, Token, Tokenizer};
|
||||||
|
|
||||||
|
use crate::{Kind, Error, Id};
|
||||||
|
|
||||||
pub struct Deserializer<'cx, 'xml> {
|
pub struct Deserializer<'cx, 'xml> {
|
||||||
pub(crate) local: &'xml str,
|
pub(crate) local: &'xml str,
|
||||||
prefix: Option<&'xml str>,
|
prefix: Option<&'xml str>,
|
||||||
|
@ -33,7 +34,7 @@ impl<'cx, 'xml> Deserializer<'cx, 'xml> {
|
||||||
Some(Ok(Node::Text(s))) => (s, true),
|
Some(Ok(Node::Text(s))) => (s, true),
|
||||||
Some(Ok(_)) => return Err(Error::ExpectedScalar),
|
Some(Ok(_)) => return Err(Error::ExpectedScalar),
|
||||||
Some(Err(e)) => return Err(e),
|
Some(Err(e)) => return Err(e),
|
||||||
None => return Ok(""),
|
None => return Err(Error::MissingValue(&Kind::Scalar)),
|
||||||
};
|
};
|
||||||
|
|
||||||
if element {
|
if element {
|
||||||
|
|
Loading…
Reference in New Issue