From 6fa0ac5d080cb95a5959ca9bf234e5e013b74b87 Mon Sep 17 00:00:00 2001 From: Pauan Date: Mon, 29 Oct 2018 20:57:47 -1000 Subject: [PATCH] Adding in mixin_if method --- src/dom.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dom.rs b/src/dom.rs index f036ae1..7cb51b9 100644 --- a/src/dom.rs +++ b/src/dom.rs @@ -449,7 +449,17 @@ impl DomBuilder { #[inline] pub fn mixin>(self, mixin: B) -> Self { - mixin.apply(self) + self.mixin_if(true, mixin) + } + + #[inline] + pub fn mixin_if>(self, test: bool, mixin: B) -> Self { + if test { + mixin.apply(self) + + } else { + self + } } }