Merge branch 'into-&String' into 'master'
Implement IntoElements and IntoAttributeValue for &String See merge request !8
This commit is contained in:
commit
8d7afc0d5c
1 changed files with 12 additions and 0 deletions
|
@ -70,6 +70,12 @@ impl IntoElements for String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> IntoElements for &'a String {
|
||||||
|
fn into_elements(self, emitter: &mut ElementEmitter) {
|
||||||
|
emitter.append_text_node(self.to_owned());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> IntoElements for &'a str {
|
impl<'a> IntoElements for &'a str {
|
||||||
fn into_elements(self, emitter: &mut ElementEmitter) {
|
fn into_elements(self, emitter: &mut ElementEmitter) {
|
||||||
emitter.append_text_node(self.to_owned());
|
emitter.append_text_node(self.to_owned());
|
||||||
|
@ -88,6 +94,12 @@ impl IntoAttributeValue for String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> IntoAttributeValue for &'a String {
|
||||||
|
fn into_attribute_value(self) -> Option<String> {
|
||||||
|
Some(self.to_owned())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> IntoAttributeValue for &'a str {
|
impl<'a> IntoAttributeValue for &'a str {
|
||||||
fn into_attribute_value(self) -> Option<String> {
|
fn into_attribute_value(self) -> Option<String> {
|
||||||
Some((*self).to_owned())
|
Some((*self).to_owned())
|
||||||
|
|
Loading…
Reference in a new issue