Adding in with_element method
This commit is contained in:
parent
7a32acd6d0
commit
4d3f936824
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue