fix: Make Writable::toggle use peek to avoid subscribing as Readable::Cloned uses Readable::read (#4166)

This commit is contained in:
Marc Espin authored and GitHub committed 2025-05-21 14:46:06 -05:00
1 parent 021c877361
commit ab76d909e1
1 file changed
+2 -1
+2 -1
View File
@@ -102,7 +102,8 @@ pub trait Writable: Readable {
where
Self::Target: std::ops::Not<Output = Self::Target> + Clone,
{
self.set(!self.cloned());
let inverted = !(*self.peek()).clone();
self.set(inverted);
}
/// Index into the inner value and return a reference to the result.