mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Handle null strings in Namespace::new.
This also avoids a string copy in the rare case of an unrecognized namespace.
This commit is contained in:
parent
4546d5d23c
commit
d3d7c1dabd
5 changed files with 21 additions and 24 deletions
|
@ -40,7 +40,7 @@ pub fn parse_namespace_rule(rule: AtRule, namespaces: &mut NamespaceMap) {
|
|||
},
|
||||
URL(value) | String(value) => {
|
||||
if ns.is_some() { syntax_error!() }
|
||||
ns = Some(Namespace::from_str(value.as_slice()));
|
||||
ns = Some(Namespace::from_str(Some(value)));
|
||||
break
|
||||
},
|
||||
_ => syntax_error!(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue