mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
down to 3 errors
This commit is contained in:
parent
ebdb8881e9
commit
8df49850ae
7 changed files with 84 additions and 81 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue