Add static cast
This commit is contained in:
parent
c47ed815b6
commit
ffda082363
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,13 @@ pub trait FutureStateChange: Fn() -> Result<()> + Send + Sync {
|
||||||
{
|
{
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn as_static(&'static self) -> &'static (dyn Fn() -> Result<()> + Send + Sync + 'static)
|
||||||
|
where
|
||||||
|
Self: Sized,
|
||||||
|
{
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<F: Fn() -> Result<()> + Clone + Send + Sync> FutureStateChange for F {
|
impl<F: Fn() -> Result<()> + Clone + Send + Sync> FutureStateChange for F {
|
||||||
|
|
Loading…
Reference in a new issue