mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Add get_ref() method to DOMString
This commit is contained in:
parent
034536e531
commit
eadda9411b
1 changed files with 7 additions and 0 deletions
|
@ -105,6 +105,13 @@ impl DOMString {
|
|||
null_string => ~""
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_ref<'a>(&'a self) -> &'a str {
|
||||
match *self {
|
||||
str(ref s) => s.as_slice(),
|
||||
null_string => &'a "",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct rust_box<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue