Change Namespace::to_str() to not allocate and return a reference.

This commit is contained in:
Simon Sapin 2013-12-09 15:10:09 +00:00
parent 28575c20bf
commit 61c7f2f220
5 changed files with 23 additions and 23 deletions

View file

@ -129,8 +129,8 @@ impl ElementLike for Element {
self.tag_name.as_slice()
}
fn get_namespace<'a>(&'a self) -> ~str {
self.namespace.to_str().unwrap_or(~"")
fn get_namespace_url<'a>(&'a self) -> &'a str {
self.namespace.to_str().unwrap_or("")
}
fn get_attr(&self, name: &str) -> Option<~str> {