From: Ian Jackson Date: Fri, 21 May 2021 19:40:56 +0000 (+0100) Subject: apitest: Provide OtterArgsSpec for &str and a new G(&str) X-Git-Tag: otter-0.6.0~89 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=40aeb892d5f13b879ca22d1c7c46c2456d6cc084;p=otter.git apitest: Provide OtterArgsSpec for &str and a new G(&str) Signed-off-by: Ian Jackson --- 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 {