misc: Automatic beta clippy fixes

e.g. cargo clippy --all --tests --all-targets --fix --features=..

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-09-20 09:46:19 +01:00
parent ab0b3f1b7b
commit f32487f8e8
11 changed files with 575 additions and 575 deletions

View File

@@ -52,7 +52,7 @@ pub struct MetricsReport {
impl Default for MetricsReport {
fn default() -> Self {
let mut git_human_readable = "".to_string();
if let Ok(git_out) = Command::new("git").args(&["describe", "--dirty"]).output() {
if let Ok(git_out) = Command::new("git").args(["describe", "--dirty"]).output() {
if git_out.status.success() {
git_human_readable = String::from_utf8(git_out.stdout)
.unwrap()
@@ -67,7 +67,7 @@ impl Default for MetricsReport {
}
let mut git_revision = "".to_string();
if let Ok(git_out) = Command::new("git").args(&["rev-parse", "HEAD"]).output() {
if let Ok(git_out) = Command::new("git").args(["rev-parse", "HEAD"]).output() {
if git_out.status.success() {
git_revision = String::from_utf8(git_out.stdout)
.unwrap()
@@ -83,7 +83,7 @@ impl Default for MetricsReport {
let mut git_commit_date = "".to_string();
if let Ok(git_out) = Command::new("git")
.args(&["show", "-s", "--format=%cd"])
.args(["show", "-s", "--format=%cd"])
.output()
{
if git_out.status.success() {

View File

@@ -92,12 +92,12 @@ pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
);
let mut child = GuestCommand::new(&guest)
.args(&["--cpus", &format!("boot={}", num_queues)])
.args(&["--memory", "size=4G"])
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.args(["--cpus", &format!("boot={}", num_queues)])
.args(["--memory", "size=4G"])
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.default_disks()
.args(&["--net", net_params.as_str()])
.args(["--net", net_params.as_str()])
.capture_output()
.verbosity(VerbosityLevel::Warn)
.set_print_cmd(false)
@@ -133,12 +133,12 @@ pub fn performance_net_latency(control: &PerformanceTestControl) -> f64 {
);
let mut child = GuestCommand::new(&guest)
.args(&["--cpus", &format!("boot={}", num_queues)])
.args(&["--memory", "size=4G"])
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.args(["--cpus", &format!("boot={}", num_queues)])
.args(["--memory", "size=4G"])
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.default_disks()
.args(&["--net", net_params.as_str()])
.args(["--net", net_params.as_str()])
.capture_output()
.verbosity(VerbosityLevel::Warn)
.set_print_cmd(false)
@@ -278,14 +278,14 @@ pub fn performance_boot_time(control: &PerformanceTestControl) -> f64 {
let mut cmd = GuestCommand::new(&guest);
let c = cmd
.args(&[
.args([
"--cpus",
&format!("boot={}", control.num_boot_vcpus.unwrap_or(1)),
])
.args(&["--memory", "size=1G"])
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.args(&["--console", "off"])
.args(["--memory", "size=1G"])
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.args(["--console", "off"])
.default_disks();
measure_boot_time(c, control.test_timeout).unwrap()
@@ -305,15 +305,15 @@ pub fn performance_boot_time_pmem(control: &PerformanceTestControl) -> f64 {
let guest = performance_test_new_guest(Box::new(focal));
let mut cmd = GuestCommand::new(&guest);
let c = cmd
.args(&[
.args([
"--cpus",
&format!("boot={}", control.num_boot_vcpus.unwrap_or(1)),
])
.args(&["--memory", "size=1G,hugepages=on"])
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(&["--cmdline", "root=/dev/pmem0p1 console=ttyS0 quiet rw"])
.args(&["--console", "off"])
.args(&[
.args(["--memory", "size=1G,hugepages=on"])
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(["--cmdline", "root=/dev/pmem0p1 console=ttyS0 quiet rw"])
.args(["--console", "off"])
.args([
"--pmem",
format!(
"file={}",
@@ -349,11 +349,11 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
.to_string();
let mut child = GuestCommand::new(&guest)
.args(&["--cpus", &format!("boot={}", num_queues)])
.args(&["--memory", "size=4G"])
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.args(&[
.args(["--cpus", &format!("boot={}", num_queues)])
.args(["--memory", "size=4G"])
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
.args([
"--disk",
format!(
"path={}",
@@ -368,7 +368,7 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
format!("path={}", BLK_IO_TEST_IMG).as_str(),
])
.default_net()
.args(&["--api-socket", &api_socket])
.args(["--api-socket", &api_socket])
.capture_output()
.verbosity(VerbosityLevel::Warn)
.set_print_cmd(false)