diff --git a/Cargo.lock b/Cargo.lock index 6cc964e..8730a30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,7 +795,6 @@ dependencies = [ name = "yewprint" version = "0.1.0" dependencies = [ - "boolinator", "heck", "id_tree", "regex", diff --git a/yewprint/Cargo.toml b/yewprint/Cargo.toml index c947d5e..19aeb65 100644 --- a/yewprint/Cargo.toml +++ b/yewprint/Cargo.toml @@ -20,9 +20,6 @@ yew = { git = "https://github.com/yewstack/yew.git", rev = "db3170f629f" } web-sys = "0.3" id_tree = { version = "1.7", optional = true } yewtil = { git = "https://github.com/yewstack/yew.git", rev = "db3170f629f", features = ["pure"] } -# NOTE: this dependency needs to be removed when the feature bool_to_option lands in stable -# https://github.com/rust-lang/rust/issues/64260 -boolinator = "2.4.0" [build-dependencies] regex = { version = "1", default-features = false, features = ["std", "unicode-perl"] } diff --git a/yewprint/src/button_group.rs b/yewprint/src/button_group.rs index da4022f..dbfad85 100644 --- a/yewprint/src/button_group.rs +++ b/yewprint/src/button_group.rs @@ -1,4 +1,3 @@ -use boolinator::Boolinator; use yew::prelude::*; pub struct ButtonGroup { @@ -47,10 +46,10 @@ impl Component for ButtonGroup {
diff --git a/yewprint/src/buttons.rs b/yewprint/src/buttons.rs index 450034d..b63dec6 100644 --- a/yewprint/src/buttons.rs +++ b/yewprint/src/buttons.rs @@ -1,5 +1,4 @@ use crate::{Icon, IconName, Intent}; -use boolinator::Boolinator; use yew::prelude::*; pub struct Button { @@ -54,9 +53,9 @@ impl Component for Button { @@ -86,12 +85,12 @@ impl Component for Tag { class=classes!( "bp3-tag", self.props.intent, - self.props.active.as_some("bp3-active"), - self.props.fill.as_some("bp3-fill"), - self.props.interactive.as_some("bp3-interactive"), - self.props.large.as_some("bp3-large"), - self.props.minimal.as_some("bp3-minimal"), - self.props.round.as_some("bp3-round"), + self.props.active.then(|| "bp3-active"), + self.props.fill.then(|| "bp3-fill"), + self.props.interactive.then(|| "bp3-interactive"), + self.props.large.then(|| "bp3-large"), + self.props.minimal.then(|| "bp3-minimal"), + self.props.round.then(|| "bp3-round"), self.props.class.clone(), ) onclick={self.props.onclick.clone()} diff --git a/yewprint/src/text.rs b/yewprint/src/text.rs index 060b3d1..163907d 100644 --- a/yewprint/src/text.rs +++ b/yewprint/src/text.rs @@ -1,4 +1,3 @@ -use boolinator::Boolinator; use yew::prelude::*; pub struct Text { @@ -46,7 +45,7 @@ impl Component for Text { <@{if self.props.inline { "span" } else { "div"}} class=classes!( self.props.class.clone(), - self.props.ellipsize.as_some("bp3-text-overflow-ellipsis"), + self.props.ellipsize.then (|| "bp3-text-overflow-ellipsis"), ) title?=self.props.title.clone() > diff --git a/yewprint/src/tree.rs b/yewprint/src/tree.rs index 626d9fc..71ea779 100644 --- a/yewprint/src/tree.rs +++ b/yewprint/src/tree.rs @@ -1,7 +1,6 @@ use crate::collapse::Collapse; use crate::icon::{Icon, IconName}; use crate::Intent; -use boolinator::Boolinator; use id_tree::*; use std::cell::{Ref, RefCell, RefMut}; use std::collections::hash_map::DefaultHasher; @@ -312,7 +311,7 @@ impl Component for TreeNode { html! {