Skip to content

Commit efbb487

Browse files
committed
Fix clippy
1 parent 3638f82 commit efbb487

File tree

9 files changed

+25
-25
lines changed

9 files changed

+25
-25
lines changed

src/actions/experiments/create.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ mod tests {
185185
let crates: Vec<Crate> = db
186186
.query(
187187
"SELECT crate FROM experiment_crates WHERE experiment = ?1 AND skipped = 0",
188-
&[&ex],
188+
[&ex],
189189
|row| {
190190
let krate: String = row.get("crate")?;
191191
Ok(krate.parse().unwrap())

src/actions/experiments/edit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ mod tests {
251251
let crates: Vec<Crate> = db
252252
.query(
253253
"SELECT crate FROM experiment_crates WHERE experiment = ?1 AND skipped = 0",
254-
&[&ex],
254+
[&ex],
255255
|row| {
256256
let krate: String = row.get("crate")?;
257257
Ok(krate.parse().unwrap())

src/report/archives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub fn write_logs_archives<DB: ReadResults, W: ReportWriter>(
163163
for (comparison, archive) in by_comparison.drain(..) {
164164
let data = archive.into_inner()?.finish()?;
165165
dest.write_bytes(
166-
&format!("logs-archives/{}.tar.gz", comparison),
166+
format!("logs-archives/{}.tar.gz", comparison),
167167
data,
168168
&"application/gzip".parse().unwrap(),
169169
EncodingType::Plain,

src/report/html.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ fn write_report<W: ReportWriter>(
123123
result_names.len() - 1
124124
});
125125
runs[pos] = Some(BuildTestResultHTML {
126-
res: *idx as usize,
126+
res: *idx,
127127
log: run.log.clone(),
128128
});
129129
}

src/report/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,13 @@ impl ReportWriter for FileWriter {
542542
_: EncodingType,
543543
) -> Fallible<()> {
544544
self.create_prefix(path.as_ref())?;
545-
fs::write(&self.0.join(path.as_ref()), &b)?;
545+
fs::write(self.0.join(path.as_ref()), b)?;
546546
Ok(())
547547
}
548548

549549
fn write_string<P: AsRef<Path>>(&self, path: P, s: Cow<str>, _: &Mime) -> Fallible<()> {
550550
self.create_prefix(path.as_ref())?;
551-
fs::write(&self.0.join(path.as_ref()), s.as_ref().as_bytes())?;
551+
fs::write(self.0.join(path.as_ref()), s.as_ref().as_bytes())?;
552552
Ok(())
553553
}
554554
}
@@ -973,19 +973,19 @@ mod tests {
973973
);
974974
assert_eq!(gh_result.res, Comparison::Regressed);
975975
assert_eq!(
976-
(&gh_result.runs[0]).as_ref().unwrap().res,
976+
gh_result.runs[0].as_ref().unwrap().res,
977977
TestResult::TestPass
978978
);
979979
assert_eq!(
980-
(&gh_result.runs[1]).as_ref().unwrap().res,
980+
gh_result.runs[1].as_ref().unwrap().res,
981981
TestResult::BuildFail(FailureReason::Unknown)
982982
);
983983
assert_eq!(
984-
Path::new((&gh_result.runs[0]).as_ref().unwrap().log.as_str()),
984+
Path::new(gh_result.runs[0].as_ref().unwrap().log.as_str()),
985985
Path::new("stable/gh/brson.hello-rs")
986986
);
987987
assert_eq!(
988-
Path::new((&gh_result.runs[1]).as_ref().unwrap().log.as_str()),
988+
Path::new(gh_result.runs[1].as_ref().unwrap().log.as_str()),
989989
Path::new("beta/gh/brson.hello-rs")
990990
);
991991

@@ -996,19 +996,19 @@ mod tests {
996996
);
997997
assert_eq!(reg_result.res, Comparison::Regressed);
998998
assert_eq!(
999-
(&reg_result.runs[0]).as_ref().unwrap().res,
999+
reg_result.runs[0].as_ref().unwrap().res,
10001000
TestResult::TestPass
10011001
);
10021002
assert_eq!(
1003-
(&reg_result.runs[1]).as_ref().unwrap().res,
1003+
reg_result.runs[1].as_ref().unwrap().res,
10041004
TestResult::BuildFail(FailureReason::Unknown)
10051005
);
10061006
assert_eq!(
1007-
Path::new((&reg_result.runs[0]).as_ref().unwrap().log.as_str()),
1007+
Path::new(reg_result.runs[0].as_ref().unwrap().log.as_str()),
10081008
Path::new("stable/reg/syn-1.0.0")
10091009
);
10101010
assert_eq!(
1011-
Path::new((&reg_result.runs[1]).as_ref().unwrap().log.as_str()),
1011+
Path::new(reg_result.runs[1].as_ref().unwrap().log.as_str()),
10121012
Path::new("beta/reg/syn-1.0.0")
10131013
);
10141014

src/runner/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ pub(super) fn test_rustdoc<DB: WriteResults>(
386386

387387
// Make sure to remove the built documentation
388388
// There is no point in storing it after the build is done
389-
remove_dir_all(&build_env.host_target_dir().join("doc"))?;
389+
remove_dir_all(build_env.host_target_dir().join("doc"))?;
390390

391391
res
392392
};

src/server/agents.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl Agents {
135135
#[cfg(test)]
136136
fn get(&self, name: &str) -> Fallible<Option<Agent>> {
137137
self.db
138-
.get_row("SELECT * FROM agents WHERE name = ?1;", &[&name], |row| {
138+
.get_row("SELECT * FROM agents WHERE name = ?1;", [&name], |row| {
139139
Ok(Agent {
140140
name: row.get("name")?,
141141
last_heartbeat: row.get("last_heartbeat")?,

tests/check_config/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ use std::process::Command;
66
#[test]
77
fn test_good_config() {
88
Command::crater()
9-
.args(&["check-config", "tests/check_config/good.toml"])
9+
.args(["check-config", "tests/check_config/good.toml"])
1010
.assert()
1111
.success();
1212
}
1313

1414
#[test]
1515
fn test_bad_config_duplicate_crate() {
1616
Command::crater()
17-
.args(&[
17+
.args([
1818
"check-config",
1919
"tests/check_config/bad-duplicate-crate.toml",
2020
])
@@ -27,7 +27,7 @@ fn test_bad_config_duplicate_crate() {
2727
#[test]
2828
fn test_bad_config_duplicate_repo() {
2929
Command::crater()
30-
.args(&["check-config", "tests/check_config/bad-duplicate-repo.toml"])
30+
.args(["check-config", "tests/check_config/bad-duplicate-repo.toml"])
3131
.assert()
3232
.failure()
3333
.code(1)
@@ -39,7 +39,7 @@ fn test_bad_config_duplicate_repo() {
3939
#[test]
4040
fn test_bad_config_missing_crate() {
4141
Command::crater()
42-
.args(&["check-config", "tests/check_config/bad-missing-crate.toml"])
42+
.args(["check-config", "tests/check_config/bad-missing-crate.toml"])
4343
.assert()
4444
.failure()
4545
.code(1)
@@ -49,7 +49,7 @@ fn test_bad_config_missing_crate() {
4949
#[test]
5050
fn test_bad_config_missing_repo() {
5151
Command::crater()
52-
.args(&["check-config", "tests/check_config/bad-missing-repo.toml"])
52+
.args(["check-config", "tests/check_config/bad-missing-repo.toml"])
5353
.assert()
5454
.failure()
5555
.code(1)

tests/minicrater/driver.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl MinicraterRun {
153153

154154
// Create local list in the temp work dir
155155
Command::crater()
156-
.args(&["create-lists", "local"])
156+
.args(["create-lists", "local"])
157157
.env("CRATER_CONFIG", &config_file)
158158
.minicrater_exec();
159159

@@ -172,7 +172,7 @@ impl MinicraterRun {
172172

173173
// Execute the experiment
174174
Command::crater()
175-
.args(&[
175+
.args([
176176
"run-graph",
177177
&ex_arg,
178178
"--threads",
@@ -189,7 +189,7 @@ impl MinicraterRun {
189189
let mut failed = false;
190190

191191
Command::crater()
192-
.args(&["gen-report", &ex_arg])
192+
.args(["gen-report", &ex_arg])
193193
.env("CRATER_CONFIG", &config_file)
194194
.arg(report_dir.path())
195195
.arg("--output-templates")
@@ -201,7 +201,7 @@ impl MinicraterRun {
201201

202202
// Delete the experiment
203203
Command::crater()
204-
.args(&["delete-ex", &ex_arg])
204+
.args(["delete-ex", &ex_arg])
205205
.env("CRATER_CONFIG", &config_file)
206206
.minicrater_exec();
207207

0 commit comments

Comments
 (0)