Adding in with_element method

This commit is contained in:
Pauan 2018-06-11 21:33:10 -10:00
parent 7a32acd6d0
commit 4d3f936824
1 changed files with 6 additions and 0 deletions

View File

@ -254,6 +254,12 @@ impl<A> DomBuilder<A> {
}
impl<A: Clone> DomBuilder<A> {
#[inline]
pub fn with_element<B, F>(self, f: F) -> B where F: FnOnce(Self, A) -> B {
let element = self.element.clone();
f(self, element)
}
#[inline]
pub fn before_inserted<F>(self, f: F) -> Self where F: FnOnce(A) {
let element = self.element.clone();