Repository: zng-ui/zng (language: rust)

Issue:
Rename `VarCapabilities` to `VarCapability`
This is the only `bitflags!` with a plural name in the project, all the others have a singular name.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 797b852ae..f63997f91 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@ fn version_0_5() -> impl UiNode {
     }
 }
 ```
+* **Breaking** Rename `VarCapabilities` to `VarCapability`.
 
 # 0.4.0
 
diff --git a/crates/zng-app/src/render.rs b/crates/zng-app/src/render.rs
index 4552b0dcd..ef519101e 100644
--- a/crates/zng-app/src/render.rs
+++ b/crates/zng-app/src/render.rs
@@ -17,7 +17,7 @@ use zng_layout::unit::{
 };
 use zng_task::rayon::iter::{ParallelBridge, ParallelIterator};
 use zng_unique_id::{impl_unique_id_bytemuck, unique_id_32};
-use zng_var::{impl_from_and_into_var, Var, VarCapabilities, VarValue};
+use zng_var::{impl_from_and_into_var, Var, VarCapability, VarValue};
 use zng_view_api::{
     api_extension::{ApiExtensionId, ApiExtensionPayload},
     config::FontAntiAliasing,
@@ -2873,7 +2873,7 @@ impl<T> FrameValueKey<T> {
     ///
     /// [`bind_var`]: Self::bind_var
     pub fn bind_var_child<VT: VarValue>(self, child_index: u32, var: &impl Var<VT>, map: impl FnOnce(&VT) -> T) -> FrameValue<T> {
-        if var.capabilities().contains(VarCapabilities::NEW) {
+        if var.capabilities().contains(VarCapability::NEW) {
             FrameValue::Bind {
                 id: self.to_wr_child(child_index),
                 value: var.with(map),
@@ -2893,7 +2893,7 @@ impl<T> FrameValueKey<T> {
     ///
     /// [`bind_var_mapped`]: Self::bind_var_mapped
     pub fn bind_var_mapped_child<VT: VarValue>(&self, child_index: u32, var: &impl Var<VT>, value: T) -> FrameValue<T> {
-        if var.capabilities().contains(VarCapabilities::NEW) {
+        if var.capabilities().contains(VarCapability::NEW) {
             FrameValue::Bind {
                 id: self.to_wr_child(child_index),
                 value,
@@ -2918,7 +2918,7 @@ impl<T> FrameValueKey<T> {
         var: &impl Var<VT>,
         map: impl FnOnce(&VT) -> T,
     ) -> Option<FrameValueUpdate<T>> {
-        if var.capabilities().contains(VarCapabilities::NEW) {
+        if var.capabilities().contains(VarCapability::NEW) {
             Some(FrameValueUpdate {
                 id: self.to_wr_child(child_index),
                 value: var.with(map),
@@ -2938,7 +2938,7 @@ impl<T> FrameValueKey<T> {
     ///
     /// [`update_var_mapped`]: Self::update_var_mapped
     pub fn update_var_mapped_child<VT: VarValue>(self, child_index: u32, var: &impl Var<VT>, value: T) -> Option<FrameValueUpdate<T>> {
-        if var.capabilities().contains(VarCapabilities::NEW) {
+        if var.capabilities().contains(VarCapability::NEW) {
             Some(FrameValueUpdate {
                 id: self.to_wr_child(child_index),
                 value,
diff --git a/crates/zng-app/src/widget.rs b/crates/zng-app/src/widget.rs
index 6701aa567..6a2b07146 100644
--- a/crates/zng-app/src/widget.rs
+++ b/crates/zng-app/src/widget.rs
@@ -1349,7 +1349,7 @@ pub trait AnyVarSubscribe: AnyVar {
     ///
     /// Variables without the [`NEW`] capability return [`VarHandle::dummy`].
     ///
-    /// [`NEW`]: zng_var::VarCapabilities::NEW
+    /// [`NEW`]: zng_var::VarCapability::NEW
     /// [`VarHandle::dummy`]: zng_var::VarHandle
     fn subscribe(&self, op: UpdateOp, widget_id: WidgetId) -> VarHandle;
 }
@@ -1371,7 +1371,7 @@ pub trait VarSubscribe<T: VarValue>: Var<T> + AnyVarSubscribe {
     ///
     /// Variables without the [`NEW`] capability return [`VarHandle::dummy`].
     ///
-    /// [`NEW`]: zng_var::VarCapabilities::NEW
+    /// [`NEW`]: zng_var::VarCapability::NEW
     /// [`VarHandle::dummy`]: zng_var::VarHandle
     fn subscribe_when(&self, op: UpdateOp, widget_id: WidgetId, predicate: impl Fn(&T) -> bool + Send + Sync + 'static) -> VarHandle;
 
diff --git a/crates/zng-var/src/arc.rs b/crates/zng-var/src/arc.rs
index 2d0961165..799f48561 100644
--- a/crates/zng-var/src/arc.rs
+++ b/crates/zng-var/src/arc.rs
@@ -91,8 +91,8 @@ impl<T: VarValue> AnyVar for ArcVar<T> {
         false
     }
 
-    fn capabilities(&self) -> VarCapabilities {
-        VarCapabilities::MODIFY
+    fn capabilities(&self) -> VarCapability {
+        VarCapability::MODIFY
     }
 
     fn hook_any(&self, pos_modify_action: Box<dyn Fn(&AnyVarHookArgs) -> bool + Send + Sync>) -> VarHandle {
diff --git a/crates/zng-var/src/boxed.rs b/crates/zng-var/src/boxed.rs
index 6a3906990..f94ab6c6a 100644
--- a/crates/zng-var/src/boxed.rs
+++ b/crates/zng-var/src/boxed.rs
@@ -79,7 +79,7 @@ impl AnyVar for Box<dyn AnyVar> {
         (**self).is_contextual()
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         (**self).capabilities()
     }
 
@@ -271,7 +271,7 @@ impl<T: VarValue> AnyVar for BoxedVar<T> {
         (**self).is_contextual()
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         (**self).capabilities()
     }
 
diff --git a/crates/zng-var/src/context.rs b/crates/zng-var/src/context.rs
index 3662912e4..c5ac97f7c 100644
--- a/crates/zng-var/src/context.rs
+++ b/crates/zng-var/src/context.rs
@@ -163,8 +163,8 @@ impl<T: VarValue> AnyVar for ContextVar<T> {
         true
     }
 
-    fn capabilities(&self) -> VarCapabilities {
-        self.0.get().capabilities() | VarCapabilities::CAPS_CHANGE
+    fn capabilities(&self) -> VarCapability {
+        self.0.get().capabilities() | VarCapability::CAPS_CHANGE
     }
 
     fn hook_any(&self, pos_modify_action: Box<dyn Fn(&AnyVarHookArgs) -> bool + Send + Sync>) -> VarHandle {
diff --git a/crates/zng-var/src/contextualized.rs b/crates/zng-var/src/contextualized.rs
index 1e9ff3c2c..7e201a020 100644
--- a/crates/zng-var/src/contextualized.rs
+++ b/crates/zng-var/src/contextualized.rs
@@ -270,7 +270,7 @@ impl<T: VarValue> AnyVar for ContextualizedVar<T> {
         true
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         self.borrow_init().capabilities()
     }
 
diff --git a/crates/zng-var/src/cow.rs b/crates/zng-var/src/cow.rs
index 7b29186f7..c8824a528 100644
--- a/crates/zng-var/src/cow.rs
+++ b/crates/zng-var/src/cow.rs
@@ -200,8 +200,8 @@ impl<T: VarValue, S: Var<T>> AnyVar for ArcCowVar<T, S> {
         }
     }
 
-    fn capabilities(&self) -> VarCapabilities {
-        VarCapabilities::MODIFY
+    fn capabilities(&self) -> VarCapability {
+        VarCapability::MODIFY
     }
 
     fn hook_any(&self, pos_modify_action: Box<dyn Fn(&AnyVarHookArgs) -> bool + Send + Sync>) -> VarHandle {
diff --git a/crates/zng-var/src/flat_map.rs b/crates/zng-var/src/flat_map.rs
index c9b1ff5fd..6f828573f 100644
--- a/crates/zng-var/src/flat_map.rs
+++ b/crates/zng-var/src/flat_map.rs
@@ -166,8 +166,8 @@ where
         self.0.read().var.is_contextual()
     }
 
-    fn capabilities(&self) -> VarCapabilities {
-        self.0.read().var.capabilities() | VarCapabilities::CAPS_CHANGE
+    fn capabilities(&self) -> VarCapability {
+        self.0.read().var.capabilities() | VarCapability::CAPS_CHANGE
     }
 
     fn hook_any(&self, pos_modify_action: Box<dyn Fn(&AnyVarHookArgs) -> bool + Send + Sync>) -> VarHandle {
diff --git a/crates/zng-var/src/future.rs b/crates/zng-var/src/future.rs
index 41c62a842..f70cca0da 100644
--- a/crates/zng-var/src/future.rs
+++ b/crates/zng-var/src/future.rs
@@ -69,7 +69,7 @@ impl<'a, V: AnyVar> Future for WaitIsNotAnimatingFut<'a, V> {
     type Output = ();
 
     fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<()> {
-        if !self.var.capabilities().contains(VarCapabilities::NEW) {
+        if !self.var.capabilities().contains(VarCapability::NEW) {
             // var cannot have new value, ready to avoid deadlock.
             self.observed_animation_start = false;
             return Poll::Ready(());
@@ -81,7 +81,7 @@ impl<'a, V: AnyVar> Future for WaitIsNotAnimatingFut<'a, V> {
                 // still animating, but received poll so an animation was overridden and stopped.
                 // try hook with new animation.
 
-                while self.var.capabilities().contains(VarCapabilities::NEW) {
+                while self.var.capabilities().contains(VarCapability::NEW) {
                     let waker = cx.waker().clone();
                     let r = self.var.hook_animation_stop(Box::new(move || {
                         waker.wake_by_ref();
@@ -124,7 +124,7 @@ impl<'a, V: AnyVar> Future for WaitIsNotAnimatingFut<'a, V> {
                 // observed `is_animating` already, changed in other thread during the `hook` setup.
                 self.observed_animation_start = true;
 
-                while self.var.capabilities().contains(VarCapabilities::NEW) {
+                while self.var.capabilities().contains(VarCapability::NEW) {
                     // hook with animation stop.
                     let waker = cx.waker().clone();
                     let r = self.var.hook_animation_stop(Box::new(move || {
diff --git a/crates/zng-var/src/lib.rs b/crates/zng-var/src/lib.rs
index 188f1b6ed..875306e90 100644
--- a/crates/zng-var/src/lib.rs
+++ b/crates/zng-var/src/lib.rs
@@ -217,7 +217,7 @@ bitflags! {
     ///
     /// You can get the current capabilities of a var by using the [`AnyVar::capabilities`] method.
     #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
-    pub struct VarCapabilities: u8 {
+    pub struct VarCapability: u8 {
         /// Var value can change.
         ///
         /// If this is set the [`AnyVar::is_new`] can be `true` in some updates, a variable can `NEW`
@@ -238,7 +238,7 @@ bitflags! {
         const CAPS_CHANGE = 0b1000_0000;
     }
 }
-impl VarCapabilities {
+impl VarCapability {
     /// Remove only the `MODIFY` flag without removing `NEW`.
     pub fn as_read_only(self) -> Self {
         Self::from_bits_truncate(self.bits() & 0b1111_1110)
@@ -262,11 +262,11 @@ impl VarCapabilities {
 
 /// Error when an attempt to modify a variable without the [`MODIFY`] capability is made.
 ///
-/// [`MODIFY`]: VarCapabilities::MODIFY
+/// [`MODIFY`]: VarCapability::MODIFY
 #[derive(Debug, Clone, Copy)]
 pub struct VarIsReadOnlyError {
     /// Variable capabilities when the request was made.
-    pub capabilities: VarCapabilities,
+    pub capabilities: VarCapability,
 }
 impl fmt::Display for VarIsReadOnlyError {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
@@ -522,7 +522,7 @@ pub trait AnyVar: Any + Send + Sync + crate::private::Sealed {
     fn is_contextual(&self) -> bool;
 
     /// Flags that indicate what operations the variable is capable of in this update.
-    fn capabilities(&self) -> VarCapabilities;
+    fn capabilities(&self) -> VarCapability;
 
     /// Gets if the [`last_update`] is the current update, meaning the variable value just changed.
     ///
@@ -561,7 +561,7 @@ pub trait AnyVar: Any + Send + Sync + crate::private::Sealed {
     ///
     /// If the variable does not have [`MODIFY`] capability the value returned is undefined.
     ///
-    /// [`MODIFY`]: VarCapabilities::MODIFY
+    /// [`MODIFY`]: VarCapability::MODIFY
     /// [`VARS.current_modify`]: VARS::current_modify
     /// [`VARS.animate`]: VARS::animate
     fn modify_importance(&self) -> usize;
@@ -2781,7 +2781,7 @@ where
     let update_output = Mutex::new(update_output);
     input.hook_any(Box::new(move |args| {
         if let Some(output) = wk_output.upgrade() {
-            if output.capabilities().contains(VarCapabilities::MODIFY) {
+            if output.capabilities().contains(VarCapability::MODIFY) {
                 if let Some(value) = args.downcast_value::<I>() {
                     update_output.lock()(value, args, output);
                 }
diff --git a/crates/zng-var/src/local.rs b/crates/zng-var/src/local.rs
index 46e43c043..b1db2b88b 100644
--- a/crates/zng-var/src/local.rs
+++ b/crates/zng-var/src/local.rs
@@ -60,8 +60,8 @@ impl<T: VarValue> AnyVar for LocalVar<T> {
         false
     }
 
-    fn capabilities(&self) -> VarCapabilities {
-        VarCapabilities::empty()
+    fn capabilities(&self) -> VarCapability {
+        VarCapability::empty()
     }
 
     fn hook_any(&self, _: Box<dyn Fn(&AnyVarHookArgs) -> bool + Send + Sync>) -> VarHandle {
diff --git a/crates/zng-var/src/map_ref.rs b/crates/zng-var/src/map_ref.rs
index ea3e56f24..3141de0f0 100644
--- a/crates/zng-var/src/map_ref.rs
+++ b/crates/zng-var/src/map_ref.rs
@@ -86,7 +86,7 @@ impl<I: VarValue, O: VarValue, S: Var<I>> AnyVar for MapRef<I, O, S> {
         self.source.is_contextual()
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         self.source.capabilities().as_read_only()
     }
 
@@ -416,7 +416,7 @@ impl<I: VarValue, O: VarValue, S: Var<I>> AnyVar for MapRefBidi<I, O, S> {
         self.source.is_contextual()
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         self.source.capabilities()
     }
 
diff --git a/crates/zng-var/src/merge.rs b/crates/zng-var/src/merge.rs
index 4ba4f8107..2d1b73973 100644
--- a/crates/zng-var/src/merge.rs
+++ b/crates/zng-var/src/merge.rs
@@ -115,7 +115,7 @@ impl<T: VarValue> ArcMergeVar<T> {
             .iter()
             .enumerate()
             .filter_map(|(i, var)| {
-                if var.capabilities().contains(VarCapabilities::NEW) {
+                if var.capabilities().contains(VarCapability::NEW) {
                     let wk_merge = wk_merge.clone();
                     let handle = var.hook_any(Box::new(move |args| {
                         if let Some(rc_merge) = wk_merge.upgrade() {
@@ -231,11 +231,11 @@ impl<T: VarValue> AnyVar for ArcMergeVar<T> {
         false // if inputs are contextual Self::new uses a ContextualizedVar wrapper.
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         if self.0.m.lock().inputs.is_empty() {
-            VarCapabilities::empty()
+            VarCapability::empty()
         } else {
-            VarCapabilities::NEW
+            VarCapability::NEW
         }
     }
 
diff --git a/crates/zng-var/src/read_only.rs b/crates/zng-var/src/read_only.rs
index 3bcde8217..e4b794882 100644
--- a/crates/zng-var/src/read_only.rs
+++ b/crates/zng-var/src/read_only.rs
@@ -77,7 +77,7 @@ impl<T: VarValue, V: Var<T>> AnyVar for ReadOnlyVar<T, V> {
         self.1.is_contextual()
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         self.1.capabilities().as_read_only()
     }
 
diff --git a/crates/zng-var/src/when.rs b/crates/zng-var/src/when.rs
index 4c52f4ef6..c8c923bfb 100644
--- a/crates/zng-var/src/when.rs
+++ b/crates/zng-var/src/when.rs
@@ -136,7 +136,7 @@ impl<T: VarValue> WhenVarBuilder<T> {
 
             // capacity can be n*2+1, but we only bet on conditions being `NEW`.
             let mut input_handles = Vec::with_capacity(rc_when.conditions.len());
-            if rc_when.default.capabilities().contains(VarCapabilities::NEW) {
+            if rc_when.default.capabilities().contains(VarCapability::NEW) {
                 input_handles.push(rc_when.default.hook_any(ArcWhenVar::handle_value(wk_when.clone(), usize::MAX)));
             }
             for (i, (c, v)) in rc_when.conditions.iter().enumerate() {
@@ -144,10 +144,10 @@ impl<T: VarValue> WhenVarBuilder<T> {
                     data.active = i;
                 }
 
-                if c.capabilities().contains(VarCapabilities::NEW) {
+                if c.capabilities().contains(VarCapability::NEW) {
                     input_handles.push(c.hook_any(ArcWhenVar::handle_condition(wk_when.clone(), i)));
                 }
-                if v.capabilities().contains(VarCapabilities::NEW) {
+                if v.capabilities().contains(VarCapability::NEW) {
                     input_handles.push(v.hook_any(ArcWhenVar::handle_value(wk_when.clone(), i)));
                 }
             }
@@ -501,11 +501,11 @@ impl<T: VarValue> AnyVar for ArcWhenVar<T> {
         }
     }
 
-    fn capabilities(&self) -> VarCapabilities {
+    fn capabilities(&self) -> VarCapability {
         if self.0.conditions.is_empty() {
             self.0.default.capabilities()
         } else {
-            self.active().capabilities() | VarCapabilities::NEW | VarCapabilities::CAPS_CHANGE
+            self.active().capabilities() | VarCapability::NEW | VarCapability::CAPS_CHANGE
         }
     }
 
diff --git a/crates/zng-wgt-text/src/node/render.rs b/crates/zng-wgt-text/src/node/render.rs
index e70456605..051c55cb9 100644
--- a/crates/zng-wgt-text/src/node/render.rs
+++ b/crates/zng-wgt-text/src/node/render.rs
@@ -235,7 +235,7 @@ pub fn render_text() -> impl UiNode {
                 .sub_var(&FONT_PALETTE_VAR)
                 .sub_var(&FONT_PALETTE_COLORS_VAR);
 
-            if FONT_COLOR_VAR.capabilities().contains(VarCapabilities::NEW) {
+            if FONT_COLOR_VAR.capabilities().contains(VarCapability::NEW) {
                 color_key = Some(FrameValueKey::new_unique());
             }
         }
diff --git a/crates/zng-wgt-toggle/src/lib.rs b/crates/zng-wgt-toggle/src/lib.rs
index cfe42fae4..85fdbdd98 100644
--- a/crates/zng-wgt-toggle/src/lib.rs
+++ b/crates/zng-wgt-toggle/src/lib.rs
@@ -101,7 +101,7 @@ pub fn checked(child: impl UiNode, checked: impl IntoVar<bool>) -> impl UiNode {
 
                 if let Some(args) = CLICK_EVENT.on(update) {
                     if args.is_primary()
-                        && checked.capabilities().contains(VarCapabilities::MODIFY)
+                        && checked.capabilities().contains(VarCapability::MODIFY)
                         && !args.propagation().is_stopped()
                         && args.is_enabled(WIDGET.id())
                     {
@@ -164,7 +164,7 @@ pub fn checked_opt(child: impl UiNode, checked: impl IntoVar<Option<bool>>) -> i
 
                 if let Some(args) = CLICK_EVENT.on(update) {
                     if args.is_primary()
-                        && checked.capabilities().contains(VarCapabilities::MODIFY)
+                        && checked.capabilities().contains(VarCapability::MODIFY)
                         && !args.propagation().is_stopped()
                         && args.is_enabled(WIDGET.id())
                     {
diff --git a/crates/zng-wgt/src/lib.rs b/crates/zng-wgt/src/lib.rs
index 897590c2d..186e18ddb 100644
--- a/crates/zng-wgt/src/lib.rs
+++ b/crates/zng-wgt/src/lib.rs
@@ -62,7 +62,7 @@ mod __prelude {
     pub use zng_var::{
         context_var, expr_var, impl_from_and_into_var, merge_var, response_done_var, response_var, state_var, var, var_from, when_var,
         AnyVar as _, AnyWeakVar as _, ArcVar, BoxedVar, ContextVar, IntoValue, IntoVar, LocalVar, ObservableVec, ReadOnlyArcVar,
-        ResponderVar, ResponseVar, Var, VarCapabilities, VarHandle, VarHandles, VarUpdateId, VarValue, WeakVar as _,
+        ResponderVar, ResponseVar, Var, VarCapability, VarHandle, VarHandles, VarUpdateId, VarValue, WeakVar as _,
     };
 
     pub use zng_layout::{
diff --git a/crates/zng/src/lib.rs b/crates/zng/src/lib.rs
index a16fbe963..746843553 100644
--- a/crates/zng/src/lib.rs
+++ b/crates/zng/src/lib.rs
@@ -747,7 +747,7 @@ mod __prelude_wgt {
     pub use zng_var::{
         context_var, expr_var, getter_var, impl_from_and_into_var, merge_var, response_done_var, response_var, state_var, var, when_var,
         AnyVar as _, AnyWeakVar as _, ArcVar, BoxedVar, ContextVar, IntoValue, IntoVar, LocalVar, ReadOnlyArcVar, ResponderVar,
-        ResponseVar, Var, VarCapabilities, VarHandle, VarHandles, VarValue, WeakVar as _,
+        ResponseVar, Var, VarCapability, VarHandle, VarHandles, VarValue, WeakVar as _,
     };
 
     pub use zng_layout::{
diff --git a/crates/zng/src/var.rs b/crates/zng/src/var.rs
index 683b97e0e..985e27c38 100644
--- a/crates/zng/src/var.rs
+++ b/crates/zng/src/var.rs
@@ -319,7 +319,7 @@ pub use zng_var::{
     context_var, expr_var, getter_var, impl_from_and_into_var, merge_var, response_done_var, response_var, state_var, var, var_default,
     var_from, when_var, AnyVar, AnyVarValue, AnyWeakVar, ArcEq, ArcVar, BoxedAnyVar, BoxedAnyWeakVar, BoxedVar, BoxedWeakVar,
     ContextInitHandle, ContextVar, IntoValue, IntoVar, LocalVar, MergeVarBuilder, ObservableVec, ReadOnlyArcVar, ReadOnlyContextVar,
-    ResponderVar, ResponseVar, TraceValueArgs, Var, VarCapabilities, VarHandle, VarHandles, VarHookArgs, VarModify, VarPtr, VarUpdateId,
+    ResponderVar, ResponseVar, TraceValueArgs, Var, VarCapability, VarHandle, VarHandles, VarHookArgs, VarModify, VarPtr, VarUpdateId,
     VarValue, WeakVar, VARS,
 };
 


Test patch:
diff --git a/tests/var.rs b/tests/var.rs
index 60971f759..9e827abb3 100644
--- a/tests/var.rs
+++ b/tests/var.rs
@@ -762,7 +762,7 @@ mod context {
 
         TEST_VAR.with_context_var(ContextInitHandle::new(), backing_var.clone(), || {
             let t = TEST_VAR;
-            assert!(t.capabilities().contains(VarCapabilities::MODIFY));
+            assert!(t.capabilities().contains(VarCapability::MODIFY));
             t.set("set!").unwrap();
         });