From bb53ff866e1458457e46f0dec828d580fb451eec Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Sun, 11 Mar 2018 16:28:55 +0100 Subject: [PATCH] Impl AsRef<[RuntimeValue]> for RuntimeArgs This impl can be used as an escape hatch if the user wants to use the inner slice. --- src/host.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/host.rs b/src/host.rs index ab38243..f13ada3 100644 --- a/src/host.rs +++ b/src/host.rs @@ -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`. ///