Skip to content

Commit a2ff2e2

Browse files
committed
Pacify clippy
1 parent 22a2ef9 commit a2ff2e2

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

tests/compiletest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use colored::*;
22
use regex::Regex;
33
use std::env;
44
use std::path::PathBuf;
5-
use ui_test::{color_eyre::Result, Config, Mode, OutputConflictHandling};
5+
use ui_test::{color_eyre::Result, Config, DependencyBuilder, Mode, OutputConflictHandling};
66

77
fn miri_path() -> PathBuf {
88
PathBuf::from(option_env!("MIRI").unwrap_or(env!("CARGO_BIN_EXE_miri")))
@@ -62,11 +62,11 @@ fn run_tests(mode: Mode, path: &str, target: Option<String>) -> Result<()> {
6262
program: miri_path(),
6363
output_conflict_handling,
6464
manifest_path: Some(std::env::current_dir()?.join("test_dependencies").join("Cargo.toml")),
65-
dependency_builder: Some((
66-
std::env::current_dir()?.join("miri"),
67-
vec!["cargo".to_string()],
68-
vec![("MIRI_SYSROOT".to_string(), std::env::var("MIRI_SYSROOT").unwrap())],
69-
)),
65+
dependency_builder: Some(DependencyBuilder {
66+
program: std::env::current_dir()?.join("miri"),
67+
args: vec!["cargo".to_string()],
68+
envs: vec![("MIRI_SYSROOT".to_string(), std::env::var("MIRI_SYSROOT").unwrap())],
69+
}),
7070
};
7171
ui_test::run_tests(config)
7272
}

ui_test/src/dependencies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn build_dependencies(config: &Config) -> Result<Vec<(String, PathBuf)>> {
1313
None => return Ok(vec![]),
1414
};
1515
let (program, args, envs): (&Path, &[_], &[_]) = match &config.dependency_builder {
16-
Some((path, args, envs)) => (path, args, envs),
16+
Some(db) => (&db.program, &db.args, &db.envs),
1717
None => (Path::new("cargo"), &[], &[]),
1818
};
1919
let mut build = Command::new(program);

ui_test/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ pub struct Config {
4444
pub manifest_path: Option<PathBuf>,
4545
/// Can be used to override what command to run instead of `cargo` to build the
4646
/// dependencies in `manifest_path`
47-
pub dependency_builder: Option<(PathBuf, Vec<String>, Vec<(String, String)>)>,
47+
pub dependency_builder: Option<DependencyBuilder>,
48+
}
49+
50+
#[derive(Debug)]
51+
pub struct DependencyBuilder {
52+
pub program: PathBuf,
53+
pub args: Vec<String>,
54+
pub envs: Vec<(String, String)>,
4855
}
4956

5057
#[derive(Debug)]

0 commit comments

Comments
 (0)