diff options
author | Ilyong Cho <ilyoan@gmail.com> | 2013-08-12 14:04:11 +0900 |
---|---|---|
committer | Jack Moffitt <jack@metajack.im> | 2013-08-15 11:36:15 -0600 |
commit | eadda9411bafec6f551c22b4cb48a29b356d3c82 (patch) | |
tree | b12d8add3dc115cbdb28ce70b8719ad18b5f9beb /src | |
parent | 034536e5313b634e02f151ebb98d64b2914b955d (diff) | |
download | servo-eadda9411bafec6f551c22b4cb48a29b356d3c82.tar.gz servo-eadda9411bafec6f551c22b4cb48a29b356d3c82.zip |
Add get_ref() method to DOMString
Diffstat (limited to 'src')
-rw-r--r-- | src/components/script/dom/bindings/utils.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index 47d02a3c944..728c1eb112e 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -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> { |