mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Adds an as_str()
method to WebIDL enums to hide slice of strings from callers. Uses the new method in two places.
This commit is contained in:
parent
4a0b730caf
commit
4d205f00b0
3 changed files with 10 additions and 5 deletions
|
@ -53,8 +53,7 @@ impl DOMParserMethods for DOMParser {
|
|||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<Root<Document>> {
|
||||
let url = self.window.get_url();
|
||||
let content_type =
|
||||
DOMString::from(DOMParserBinding::SupportedTypeValues::strings[ty as usize]);
|
||||
let content_type = DOMString::from(ty.as_str());
|
||||
let doc = self.window.Document();
|
||||
let loader = DocumentLoader::new(&*doc.loader());
|
||||
match ty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue