derive shared result
All checks were successful
buildbot/cargo fmt (1.72) Build done.
buildbot/cargo doc (1.72) Build done.
buildbot/cargo clippy (1.72) Build done.
buildbot/cargo test (1.65) Build done.
buildbot/cargo clippy (1.65) Build done.

This commit is contained in:
AF 2023-10-15 14:09:41 +00:00
parent e83f170dda
commit 43f20710a4

View File

@ -14,28 +14,9 @@
use crate::func::class_prelude::*;
#[derive(SharedFunctorAny)]
pub struct ResultInstance<E: Send>(E);
impl<E: Send + Sync + Clone> SharedFunctorAny for ResultInstance<E> {
type SharedAny<'a, A: 'a + Send + Sync + Clone> = Self::FAny<'a, A>
where
Self: 'a;
fn share<'a, A: 'a + Send + Sync + Clone>(fa: Self::FAny<'a, A>) -> Self::SharedAny<'a, A>
where
Self: 'a,
{
fa
}
fn unshare<'a, A: 'a + Send + Sync + Clone>(sa: Self::SharedAny<'a, A>) -> Self::FAny<'a, A>
where
Self: 'a,
{
sa
}
}
impl<E: Send> WeakFunctorAny for ResultInstance<E> {
type FAny<'a, A: 'a + Send> = Result<A, E> where Self: 'a;
}