Skip to content

Commit c43f99a

Browse files
xtask: Fix "needless borrow" clippy lints
1 parent 2fe8ed0 commit c43f99a

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

xtask/src/cargo.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl Cargo {
141141
CargoAction::Clippy => {
142142
action = "clippy";
143143
if self.warnings_as_errors {
144-
tool_args.extend(&["-D", "warnings"]);
144+
tool_args.extend(["-D", "warnings"]);
145145
}
146146
}
147147
CargoAction::Doc { open } => {
@@ -172,7 +172,7 @@ impl Cargo {
172172
}
173173

174174
if let Some(target) = self.target {
175-
cmd.args(&[
175+
cmd.args([
176176
"--target",
177177
target.as_triple(),
178178
"-Zbuild-std=core,compiler_builtins,alloc",
@@ -184,11 +184,11 @@ impl Cargo {
184184
bail!("packages cannot be empty");
185185
}
186186
for package in &self.packages {
187-
cmd.args(&["--package", package.as_str()]);
187+
cmd.args(["--package", package.as_str()]);
188188
}
189189

190190
if !self.features.is_empty() {
191-
cmd.args(&[
191+
cmd.args([
192192
"--features",
193193
&Feature::comma_separated_string(&self.features),
194194
]);

xtask/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn test_latest_release() -> Result<()> {
154154
let tmp_dir = tmp_dir.path();
155155
let mut cp_cmd = Command::new("cp");
156156
cp_cmd
157-
.args(&["--recursive", "--verbose", "template"])
157+
.args(["--recursive", "--verbose", "template"])
158158
.arg(tmp_dir);
159159
run_cmd(cp_cmd)?;
160160

@@ -163,7 +163,7 @@ fn test_latest_release() -> Result<()> {
163163
let mut build_cmd = Command::new("cargo");
164164
fix_nested_cargo_env(&mut build_cmd);
165165
build_cmd
166-
.args(&["build", "--target", "x86_64-unknown-uefi"])
166+
.args(["build", "--target", "x86_64-unknown-uefi"])
167167
.current_dir(tmp_dir.join("template"));
168168

169169
// Check that the command is indeed in BUILDING.md, then verify the

xtask/src/pipe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn windows_open_pipe(path: &Path) -> Result<File> {
9090
loop {
9191
attempt += 1;
9292

93-
match OpenOptions::new().read(true).write(true).open(&path) {
93+
match OpenOptions::new().read(true).write(true).open(path) {
9494
Ok(file) => return Ok(file),
9595
Err(err) => {
9696
if attempt >= max_attempts {

xtask/src/qemu.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -420,27 +420,27 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
420420
// QEMU by defaults enables a ton of devices which slow down boot.
421421
cmd.arg("-nodefaults");
422422

423-
cmd.args(&["-device", "virtio-rng-pci"]);
423+
cmd.args(["-device", "virtio-rng-pci"]);
424424

425425
match arch {
426426
UefiArch::AArch64 => {
427427
// Use a generic ARM environment. Sadly qemu can't emulate a
428428
// RPi 4 like machine though.
429-
cmd.args(&["-machine", "virt"]);
429+
cmd.args(["-machine", "virt"]);
430430

431431
// A72 is a very generic 64-bit ARM CPU in the wild.
432-
cmd.args(&["-cpu", "cortex-a72"]);
432+
cmd.args(["-cpu", "cortex-a72"]);
433433
}
434434
UefiArch::IA32 => {}
435435
UefiArch::X86_64 => {
436436
// Use a modern machine.
437-
cmd.args(&["-machine", "q35"]);
437+
cmd.args(["-machine", "q35"]);
438438

439439
// Multi-processor services protocol test needs exactly 4 CPUs.
440-
cmd.args(&["-smp", "4"]);
440+
cmd.args(["-smp", "4"]);
441441

442442
// Allocate some memory.
443-
cmd.args(&["-m", "256M"]);
443+
cmd.args(["-m", "256M"]);
444444

445445
// Enable hardware-accelerated virtualization if possible.
446446
if platform::is_linux() && !opt.disable_kvm && !opt.ci {
@@ -453,11 +453,11 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
453453
}
454454

455455
// Map the QEMU exit signal to port f4.
456-
cmd.args(&["-device", "isa-debug-exit,iobase=0xf4,iosize=0x04"]);
456+
cmd.args(["-device", "isa-debug-exit,iobase=0xf4,iosize=0x04"]);
457457

458458
// OVMF debug builds can output information to a serial `debugcon`.
459459
// Only enable when debugging UEFI boot.
460-
// cmd.args(&[
460+
// cmd.args([
461461
// "-debugcon",
462462
// "file:debug.log",
463463
// "-global",
@@ -489,9 +489,9 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
489489

490490
// When running in headless mode we don't have video, but we can still have
491491
// QEMU emulate a display and take screenshots from it.
492-
cmd.args(&["-vga", "std"]);
492+
cmd.args(["-vga", "std"]);
493493
if opt.headless {
494-
cmd.args(&["-display", "none"]);
494+
cmd.args(["-display", "none"]);
495495
}
496496

497497
let test_disk = tmp_dir.join("test_disk.fat.img");
@@ -511,14 +511,14 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
511511
// and send the response. That second will also receive logs up
512512
// until the test runner opens the handle in exclusive mode, but we
513513
// can just read and ignore those lines.
514-
cmd.args(&["-serial", "stdio"]);
515-
cmd.args(&["-serial", serial_pipe.qemu_arg()]);
514+
cmd.args(["-serial", "stdio"]);
515+
cmd.args(["-serial", serial_pipe.qemu_arg()]);
516516

517517
// Map the QEMU monitor to a pair of named pipes
518-
cmd.args(&["-qmp", qemu_monitor_pipe.qemu_arg()]);
518+
cmd.args(["-qmp", qemu_monitor_pipe.qemu_arg()]);
519519

520520
// Attach network device with DHCP configured for PXE
521-
cmd.args(&[
521+
cmd.args([
522522
"-nic",
523523
"user,model=e1000,net=192.168.17.0/24,tftp=uefi-test-runner/tftp/,bootfile=fake-boot-file",
524524
]);

0 commit comments

Comments
 (0)