From 06097a9d35e4336ca722bfc62a91b2cdeb0994da Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 21 May 2021 20:11:33 +0100 Subject: [PATCH] apitest: Pass ds into OtterArgsSpec Signed-off-by: Ian Jackson --- apitest/apitest.rs | 10 ++++++---- apitest/main.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apitest/apitest.rs b/apitest/apitest.rs index dea84a08..9d1151de 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -742,16 +742,18 @@ impl Drop for OtterOutput { } pub trait OtterArgsSpec { - fn to_args(&self) -> Vec; + fn to_args(&self, ds: &DirSubst) -> Vec; } impl OtterArgsSpec for [S] where for <'s> &'s S: Into { - fn to_args(&self) -> Vec { + fn to_args(&self, _: &DirSubst) -> Vec { self.iter().map(|s| s.into()).collect() } } impl OtterArgsSpec for Vec where for <'s> &'s S: Into { - fn to_args(&self) -> Vec { self.as_slice().to_args() } + fn to_args(&self, ds: &DirSubst) -> Vec { + self.as_slice().to_args(ds) + } } impl DirSubst { @@ -780,7 +782,7 @@ impl DirSubst { let mut args: Vec = vec![]; args.push("--config" .to_owned()); args.push(prctx.resolve(&CONFIG)); args.push("--spec-dir".to_owned()); args.push(prctx.resolve(&specs) ); - args.extend(xargs.to_args()); + args.extend(xargs.to_args(ds)); let dbg = format!("running {} {:?}", &exe, &args); let mut output = NamedTempFile::new_in( ds.subst("@abstmp@").unwrap() diff --git a/apitest/main.rs b/apitest/main.rs index 6c8dd0dd..38d4035b 100644 --- a/apitest/main.rs +++ b/apitest/main.rs @@ -490,7 +490,7 @@ impl UsualCtx { pub fn otter(&mut self, args: &dyn OtterArgsSpec) -> OtterOutput { let args: Vec = ["--account", "server:"].iter().cloned().map(Into::into) - .chain(args.to_args().into_iter()) + .chain(args.to_args(&self.su().ds).into_iter()) .collect(); self.su().ds.otter_prctx(&self.prctx, &args)? } -- 2.30.2