Add Element::into_document
It's more convenient in some cases and also makes the example code less "misleading": Now the string represents a full, correct HTML document.
This commit is contained in:
parent
b377ee2936
commit
6f0ae129fa
4 changed files with 20 additions and 10 deletions
|
|
@ -239,6 +239,14 @@ impl Element {
|
|||
self.add(c);
|
||||
self
|
||||
}
|
||||
|
||||
/// Convert this element into a [`Document`].
|
||||
///
|
||||
/// This function is equivalent to calling `self.into()` but may be more
|
||||
/// convenient in some cases.
|
||||
pub fn into_document(self) -> Document {
|
||||
self.into()
|
||||
}
|
||||
}
|
||||
|
||||
/// A component can add itself to an [`Element`] by modifying it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue