mirror of
https://github.com/Zenithsiz/dynatos.git
synced 2026-02-08 04:55:59 +00:00
Loadable now implements SignalGetClone.
This commit is contained in:
parent
e3c425afff
commit
45f133c4ea
@ -6,7 +6,7 @@ use std::{
|
||||
ops::{ControlFlow, FromResidual, Try},
|
||||
};
|
||||
|
||||
use dynatos_reactive::SignalGetCopy;
|
||||
use dynatos_reactive::{SignalGetClone, SignalGetCopy};
|
||||
|
||||
/// Loadable value.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@ -216,6 +216,12 @@ impl<T: Copy, E> SignalGetCopy<Loadable<T, E>> for Loadable<&'_ T, E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone, E> SignalGetClone<Loadable<T, E>> for Loadable<&'_ T, E> {
|
||||
fn clone(self) -> Loadable<T, E> {
|
||||
self.map(|value| value.clone())
|
||||
}
|
||||
}
|
||||
|
||||
/// Extension trait for iterators of `Loadable<T, E>`
|
||||
#[extend::ext(name = IteratorLoadableExt)]
|
||||
pub impl<I, T, E> I
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user