mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make Attr::prefix return an Option<&Prefix>
This commit is contained in:
parent
a377caa7e9
commit
fb206e2b10
3 changed files with 7 additions and 7 deletions
|
@ -81,8 +81,8 @@ impl Attr {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn prefix(&self) -> &Option<Prefix> {
|
||||
&self.identifier.prefix
|
||||
pub fn prefix(&self) -> Option<&Prefix> {
|
||||
self.identifier.prefix.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ impl AttrMethods for Attr {
|
|||
// https://dom.spec.whatwg.org/#dom-attr-prefix
|
||||
fn GetPrefix(&self) -> Option<DOMString> {
|
||||
// FIXME(ajeffrey): convert directly from LocalName to DOMString
|
||||
self.prefix().as_ref().map(|p| DOMString::from(&**p))
|
||||
self.prefix().map(|p| DOMString::from(&**p))
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-attr-ownerelement
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue