mirror of
https://github.com/danbulant/cushy
synced 2026-06-19 22:41:10 +00:00
Debug for WeakDynamic
This commit is contained in:
parent
2ad583926b
commit
641ae3a17d
2 changed files with 15 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
This dynamic is also accessible through `RunningWindow::inner_size`, which is
|
||||
accessible through contexts passed into various `Widget` functions.
|
||||
- `Progress` now implements `Default` by returning `Progress::Indeterminant`.
|
||||
- `WeakDynamic<T>` now implements `Debug` when `T` is `Debug`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
|||
14
src/value.rs
14
src/value.rs
|
|
@ -1205,6 +1205,20 @@ impl<T> WeakDynamic<T> {
|
|||
self.0.upgrade().map(Dynamic)
|
||||
}
|
||||
}
|
||||
impl<T> Debug for WeakDynamic<T>
|
||||
where
|
||||
T: Debug,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if let Some(strong) = self.upgrade() {
|
||||
Debug::fmt(&strong, f)
|
||||
} else {
|
||||
f.debug_tuple("WeakDynamic")
|
||||
.field(&"<pending drop>")
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<&'a Dynamic<T>> for WeakDynamic<T> {
|
||||
fn from(value: &'a Dynamic<T>) -> Self {
|
||||
|
|
|
|||
Loading…
Reference in a new issue