Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add get_ref() method to DOMString
  • Loading branch information
ILyoan authored and metajack committed Aug 15, 2013
1 parent 034536e commit eadda94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/script/dom/bindings/utils.rs
Expand Up @@ -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> {
Expand Down

0 comments on commit eadda94

Please sign in to comment.