wip: down to 13 errors

This commit is contained in:
🪞👃🪞 2025-05-14 14:35:19 +03:00
parent 6ce83fb27a
commit ebdb8881e9
19 changed files with 793 additions and 691 deletions

View file

@ -18,6 +18,16 @@ pub trait Has<T>: Send + Sync {
fn get_mut (&mut self) -> &mut T;
}
pub trait MaybeHas<T>: Send + Sync {
fn get (&self) -> Option<&T>;
}
impl<T, U: Has<Option<T>>> MaybeHas<T> for U {
fn get (&self) -> Option<&T> {
Has::<Option<T>>::get(self).as_ref()
}
}
#[macro_export] macro_rules! has {
($T:ty: |$self:ident : $S:ty| $x:expr) => {
impl Has<$T> for $S {