mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
Fix datatype validation to be case-sensitive
This commit is contained in:
parent
8c7e9fab85
commit
1d99e9a298
1 changed files with 4 additions and 4 deletions
|
@ -305,11 +305,11 @@ impl FromStr for Datatype {
|
|||
return Err(Error::Other("Encountered invalid validation datatype.").into());
|
||||
};
|
||||
|
||||
let parsed_datatype = match datatype.to_ascii_lowercase().as_str() {
|
||||
"anyuri" => Datatype::AnyUri,
|
||||
let parsed_datatype = match datatype {
|
||||
"anyURI" => Datatype::AnyUri,
|
||||
"byte" => Datatype::Byte,
|
||||
"date" => Datatype::Date,
|
||||
"datetime" => Datatype::DateTime,
|
||||
"dateTime" => Datatype::DateTime,
|
||||
"decimal" => Datatype::Decimal,
|
||||
"double" => Datatype::Double,
|
||||
"int" => Datatype::Int,
|
||||
|
@ -362,7 +362,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_parse_datatype() -> Result<(), Error> {
|
||||
assert_eq!(Datatype::AnyUri, "xs:anyURI".parse()?);
|
||||
assert_eq!(Datatype::AnyUri, "xs:anyuri".parse()?);
|
||||
assert!("xs:anyuri".parse::<Datatype>().is_err());
|
||||
assert!("xs:".parse::<Datatype>().is_err());
|
||||
assert_eq!(
|
||||
Datatype::AnyUri.into_attribute_value(),
|
||||
|
|
Loading…
Reference in a new issue