chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6db0f76
)
apitest: Provide OtterArgsSpec for &str and a new G(&str)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 21 May 2021 19:40:56 +0000
(20:40 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 21 May 2021 19:46:00 +0000
(20:46 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/apitest.rs
patch
|
blob
|
history
diff --git
a/apitest/apitest.rs
b/apitest/apitest.rs
index 26cfdf645d3a2c94f119a7ba0d4782ef7a30348a..2a34fa695b2f67f7daaee22230e99efca967af33 100644
(file)
--- a/
apitest/apitest.rs
+++ b/
apitest/apitest.rs
@@
-747,6
+747,18
@@
impl<S> OtterArgsSpec for Vec<S> where for <'s> &'s S: Into<String> {
self.as_slice().to_args(ds)
}
}
+impl OtterArgsSpec for &str {
+ fn to_args(&self, ds: &dyn Substitutor) -> Vec<String> {
+ ds.ss(self).expect(self)
+ }
+}
+impl OtterArgsSpec for G<&str> {
+ fn to_args(&self, ds: &dyn Substitutor) -> Vec<String> {
+ ds.gss(self.0).expect(self.0)
+ }
+}
+#[derive(Debug,Clone)]
+pub struct G<T>(pub T);
impl DirSubst {
pub fn specs_dir(&self) -> String {