Added AnyArguments

This commit is contained in:
wrk 2023-06-02 00:20:46 +02:00
parent 18dd20db3c
commit a1b1435b72
1 changed files with 22 additions and 0 deletions

View File

@ -108,6 +108,28 @@ impl<'a> SystemParam for IrcPrefix<'a> {
}
}
pub struct AnyArguments<'a>(&'a [&'a str]);
impl<'a> Deref for AnyArguments<'a> {
type Target = &'a [&'a str];
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<'a> SystemParam for AnyArguments<'a> {
type Item<'new> = AnyArguments<'new>;
fn retrieve<'r>(
_prefix: &'r IrcPrefix,
arguments: &'r [&'r str],
_factory: &'r Factory,
) -> Self::Item<'r> {
AnyArguments(&arguments)
}
}
pub struct Arguments<'a, const N: usize>(&'a [&'a str]);
impl<'a, const N: usize> Deref for Arguments<'a, N> {