Move Tree to a feature (because it requires an extra dependency)

This commit is contained in:
Cecile Tonglet 2020-10-01 22:23:02 +02:00
parent 3b5aef7a24
commit 3149778317
2 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,10 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["tree"]
tree = ["id_tree"]
[badges] [badges]
travis-ci = { repository = "cecton/yewprint", branch = "main" } travis-ci = { repository = "cecton/yewprint", branch = "main" }
is-it-maintained-issue-resolution = { repository = "cecton/yewprint" } is-it-maintained-issue-resolution = { repository = "cecton/yewprint" }
@ -14,7 +18,7 @@ is-it-maintained-open-issues = { repository = "cecton/yewprint" }
[dependencies] [dependencies]
yew = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b" } yew = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b" }
web-sys = "0.3" web-sys = "0.3"
id_tree = "1.7" id_tree = { version = "1.7", optional = true }
yewtil = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b", features = ["pure"] } yewtil = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b", features = ["pure"] }
[build-dependencies] [build-dependencies]

View file

@ -7,6 +7,7 @@ mod icon;
mod menu; mod menu;
mod progressbar; mod progressbar;
mod switch; mod switch;
#[cfg(feature = "tree")]
mod tree; mod tree;
pub use buttons::*; pub use buttons::*;
@ -15,10 +16,12 @@ pub use card::*;
pub use collapse::*; pub use collapse::*;
pub use html_elements::*; pub use html_elements::*;
pub use icon::*; pub use icon::*;
#[cfg(feature = "tree")]
pub use id_tree; pub use id_tree;
pub use menu::*; pub use menu::*;
pub use progressbar::*; pub use progressbar::*;
pub use switch::*; pub use switch::*;
#[cfg(feature = "tree")]
pub use tree::*; pub use tree::*;
use std::ops::{Deref, DerefMut, Not}; use std::ops::{Deref, DerefMut, Not};