Impl AsRef<[RuntimeValue]> for RuntimeArgs

This impl can be used as an escape hatch if the user wants to use the inner slice.
This commit is contained in:
Sergey Pepyakin 2018-03-11 16:28:55 +01:00
parent 4bf4c67a48
commit bb53ff866e
1 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,12 @@ impl<'a> From<&'a [RuntimeValue]> for RuntimeArgs<'a> {
}
}
impl<'a> AsRef<[RuntimeValue]> for RuntimeArgs<'a> {
fn as_ref(&self) -> &[RuntimeValue] {
self.0
}
}
impl<'a> RuntimeArgs<'a> {
/// Extract argument by index `idx`.
///