add debug impl

This commit is contained in:
Evan Almloff 2023-08-04 14:49:52 -07:00
parent 0be5dbe715
commit 3242fc9e88

View file

@ -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);