fix: Make Writable::toggle use peek to avoid subscribing as Readable::Cloned uses Readable::read (#4166)
This commit is contained in:
1 parent
021c877361
commit
ab76d909e1
1 file changed
+2
-1
@@ -102,7 +102,8 @@ pub trait Writable: Readable {
|
|||||||
where
|
where
|
||||||
Self::Target: std::ops::Not<Output = Self::Target> + Clone,
|
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.
|
/// Index into the inner value and return a reference to the result.
|
||||||
|
|||||||
Reference in new issue
Block a user