|
@@ -1,6 +1,6 @@
|
|
|
use std::{
|
|
|
cell::{Ref, RefMut},
|
|
|
- fmt::Display,
|
|
|
+ fmt::{Debug, Display},
|
|
|
ops::{Add, Div, Mul, Sub},
|
|
|
sync::Arc,
|
|
|
};
|
|
@@ -92,6 +92,12 @@ impl<T: Display + 'static> Display for Signal<T> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+impl<T: Debug + 'static> Debug for Signal<T> {
|
|
|
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
+ self.with(|v| Debug::fmt(v, f))
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
impl<T: Add<Output = T> + Copy + 'static> std::ops::AddAssign<T> for Signal<T> {
|
|
|
fn add_assign(&mut self, rhs: T) {
|
|
|
self.set(self.get() + rhs);
|