From aedfc9e0c13787459ca596d21f6d70eea102901f Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Wed, 3 Feb 2021 15:17:43 -0800 Subject: [PATCH] Replace wasmer_enumset with enumset 1.0.3 --- cursive-core/Cargo.toml | 4 ++-- cursive-core/src/lib.rs | 2 +- cursive-core/src/theme/effect.rs | 2 +- cursive-core/src/theme/style.rs | 4 ++-- cursive-core/src/views/linear_layout.rs | 10 +++++----- cursive-core/src/views/list_view.rs | 4 ---- cursive-core/src/views/text_view.rs | 3 --- cursive/Cargo.toml | 2 +- cursive/src/lib.rs | 2 +- 9 files changed, 13 insertions(+), 20 deletions(-) diff --git a/cursive-core/Cargo.toml b/cursive-core/Cargo.toml index cf6e688..fd23aac 100644 --- a/cursive-core/Cargo.toml +++ b/cursive-core/Cargo.toml @@ -22,7 +22,7 @@ repository = "gyscos/cursive" [dependencies] enum-map = "0.6" -wasmer_enumset = "1" +enumset = "1.0.3" log = "0.4" owning_ref = "0.4" syn = "1.0" @@ -33,7 +33,7 @@ libc = "0.2" crossbeam-channel = "0.5" lazy_static = "1" chrono = "0.4" -ahash = "0.6" +ahash = "0.7" [dependencies.toml] optional = true diff --git a/cursive-core/src/lib.rs b/cursive-core/src/lib.rs index 234f6ce..ee1290c 100644 --- a/cursive-core/src/lib.rs +++ b/cursive-core/src/lib.rs @@ -9,7 +9,7 @@ //! [`cursive`]: https://docs.rs/cursive #![deny(missing_docs)] -extern crate wasmer_enumset as enumset; +pub use enumset; macro_rules! new_default( ($c:ident<$t:ident>) => { diff --git a/cursive-core/src/theme/effect.rs b/cursive-core/src/theme/effect.rs index 3f294ca..a681b32 100644 --- a/cursive-core/src/theme/effect.rs +++ b/cursive-core/src/theme/effect.rs @@ -1,4 +1,4 @@ -use enumset::EnumSetType; +use enumset::{EnumSet, EnumSetType}; /// Text effect #[allow(clippy::derive_hash_xor_eq)] // We do derive it through EnumSetType diff --git a/cursive-core/src/theme/style.rs b/cursive-core/src/theme/style.rs index 775412d..efe8f8c 100644 --- a/cursive-core/src/theme/style.rs +++ b/cursive-core/src/theme/style.rs @@ -1,7 +1,7 @@ use std::iter::FromIterator; use super::{Color, ColorStyle, ColorType, Effect, PaletteColor}; -use enumset::{enum_set, EnumSet}; +use enumset::EnumSet; /// Combine a color and an effect. /// @@ -53,7 +53,7 @@ impl Style { impl From for Style { fn from(effect: Effect) -> Self { Style { - effects: enum_set!(effect), + effects: EnumSet::only(effect), color: ColorStyle::inherit_parent(), } } diff --git a/cursive-core/src/views/linear_layout.rs b/cursive-core/src/views/linear_layout.rs index f916576..069b283 100644 --- a/cursive-core/src/views/linear_layout.rs +++ b/cursive-core/src/views/linear_layout.rs @@ -39,7 +39,7 @@ struct Child { last_size: Vec2, - weight: usize, + _weight: usize, } impl Child { @@ -150,14 +150,14 @@ impl LinearLayout { /// /// Panics if `i >= self.len()`. pub fn set_weight(&mut self, i: usize, weight: usize) { - self.children[i].weight = weight; + self.children[i]._weight = weight; } /// Modifies the weight of the last child added. /// /// It is an error to call this before adding a child (and it will panic). pub fn weight(mut self, weight: usize) -> Self { - self.children.last_mut().unwrap().weight = weight; + self.children.last_mut().unwrap()._weight = weight; self } @@ -175,7 +175,7 @@ impl LinearLayout { view: view.into_boxed_view(), required_size: Vec2::zero(), last_size: Vec2::zero(), - weight: 0, + _weight: 0, }); self.invalidate(); } @@ -196,7 +196,7 @@ impl LinearLayout { view: view.into_boxed_view(), required_size: Vec2::zero(), last_size: Vec2::zero(), - weight: 0, + _weight: 0, }, ); self.invalidate(); diff --git a/cursive-core/src/views/list_view.rs b/cursive-core/src/views/list_view.rs index fcbcbc0..a043314 100644 --- a/cursive-core/src/views/list_view.rs +++ b/cursive-core/src/views/list_view.rs @@ -40,7 +40,6 @@ pub struct ListView { focus: usize, // This callback is called when the selection is changed. on_select: Option>, - last_size: Vec2, } new_default!(ListView); @@ -53,7 +52,6 @@ impl ListView { children_heights: Vec::new(), focus: 0, on_select: None, - last_size: Vec2::zero(), } } @@ -332,8 +330,6 @@ impl View for ListView { } fn layout(&mut self, size: Vec2) { - self.last_size = size; - // We'll show 2 columns: the labels, and the views. let label_width = self .children diff --git a/cursive-core/src/views/text_view.rs b/cursive-core/src/views/text_view.rs index c2e58d2..676776d 100644 --- a/cursive-core/src/views/text_view.rs +++ b/cursive-core/src/views/text_view.rs @@ -201,7 +201,6 @@ pub struct TextView { wrap: bool, // ScrollBase make many scrolling-related things easier - last_size: Vec2, width: Option, } @@ -237,7 +236,6 @@ impl TextView { rows: Vec::new(), wrap: true, align: Align::top_left(), - last_size: Vec2::zero(), width: None, } } @@ -424,7 +422,6 @@ impl View for TextView { fn layout(&mut self, size: Vec2) { // Compute the text rows. - self.last_size = size; self.compute_rows(size); // The entire "virtual" size (includes all rows) diff --git a/cursive/Cargo.toml b/cursive/Cargo.toml index 5af5ecc..1fda47c 100644 --- a/cursive/Cargo.toml +++ b/cursive/Cargo.toml @@ -18,7 +18,7 @@ features = ["unstable_scroll", "markdown", "toml"] cursive_core = { path = "../cursive-core", version= "0.2.2"} crossbeam-channel = "0.5" cfg-if = "1" -wasmer_enumset = "1" +enumset = "1.0.3" unicode-segmentation = "1" unicode-width = "0.1" lazy_static = "1" diff --git a/cursive/src/lib.rs b/cursive/src/lib.rs index 33071e1..9d5abdf 100644 --- a/cursive/src/lib.rs +++ b/cursive/src/lib.rs @@ -64,7 +64,7 @@ //! [`cursive::theme`]: ./theme/index.html #![deny(missing_docs)] -extern crate wasmer_enumset as enumset; +pub use enumset; pub use cursive_core::*;