From 40aeb892d5f13b879ca22d1c7c46c2456d6cc084 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 21 May 2021 20:40:56 +0100 Subject: [PATCH] apitest: Provide OtterArgsSpec for &str and a new G(&str) Signed-off-by: Ian Jackson --- apitest/apitest.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apitest/apitest.rs b/apitest/apitest.rs index 26cfdf64..2a34fa69 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -747,6 +747,18 @@ impl OtterArgsSpec for Vec where for <'s> &'s S: Into { self.as_slice().to_args(ds) } } +impl OtterArgsSpec for &str { + fn to_args(&self, ds: &dyn Substitutor) -> Vec { + ds.ss(self).expect(self) + } +} +impl OtterArgsSpec for G<&str> { + fn to_args(&self, ds: &dyn Substitutor) -> Vec { + ds.gss(self.0).expect(self.0) + } +} +#[derive(Debug,Clone)] +pub struct G(pub T); impl DirSubst { pub fn specs_dir(&self) -> String { -- 2.30.2