down to 3 errors

This commit is contained in:
🪞👃🪞 2025-05-14 14:56:12 +03:00
parent ebdb8881e9
commit 8df49850ae
7 changed files with 84 additions and 81 deletions

View file

@ -37,6 +37,14 @@ impl<T, U: Has<Option<T>>> MaybeHas<T> for U {
};
}
#[macro_export] macro_rules! as_ref {
($T:ty: |$self:ident : $S:ty| $x:expr) => {
impl AsRef<$T> for $S {
fn as_ref (&$self) -> &$T { &$x }
}
};
}
pub trait HasN<T>: Send + Sync {
fn get_nth (&self, key: usize) -> &T;
fn get_nth_mut (&mut self, key: usize) -> &mut T;