mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 14:44:12 +00:00
add debug impl
This commit is contained in:
parent
0be5dbe715
commit
3242fc9e88
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue