Skip to content

Commit

Permalink
Merge two if conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Sep 3, 2023
1 parent 220c269 commit 983f219
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,11 @@ impl NamespaceResolver {
}
Some(PrefixDeclaration::Named(prefix)) => {
let start = buffer.len();
let ns = Namespace(&v);

if v == RESERVED_NAMESPACE_XMLNS.1.into_inner() {
// error, non-`xmlns` prefix set to xmlns uri
return Err(Error::ReservedNamespaceError {
prefix: String::from_utf8(prefix.to_vec()).unwrap(),
name: String::from_utf8(v.to_vec()).unwrap(),
});
} else if v == RESERVED_NAMESPACE_XML.1.into_inner() {
if ns == RESERVED_NAMESPACE_XML.1 || ns == RESERVED_NAMESPACE_XMLNS.1 {
// error, non-`xml` prefix set to xml uri
// error, non-`xmlns` prefix set to xmlns uri
return Err(Error::ReservedNamespaceError {
prefix: String::from_utf8(prefix.to_vec()).unwrap(),
name: String::from_utf8(v.to_vec()).unwrap(),
Expand Down

0 comments on commit 983f219

Please sign in to comment.