add debug impl
This commit is contained in:
1 parent
0be5dbe715
commit
3242fc9e88
1 file changed
+7
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user