mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Fix beta clippy issues
Fixing the following clippy issue using `cargo clippy --fix`:
error: variables can be used directly in the `format!` string
--> build.rs:25:27
|
25 | version.push_str(&format!("-{}", extra_version));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
@@ -916,9 +916,8 @@ fn check_sequential_events(expected_events: &[&MetaEvent], event_file: &str) ->
|
||||
if !ret {
|
||||
eprintln!(
|
||||
"\n\n==== Start 'check_sequential_events' failed ==== \
|
||||
\n\nexpected_events={:?}\nactual_events={:?} \
|
||||
\n\nexpected_events={expected_events:?}\nactual_events={json_events:?} \
|
||||
\n\n==== End 'check_sequential_events' failed ====",
|
||||
expected_events, json_events,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -936,9 +935,8 @@ fn check_sequential_events_exact(expected_events: &[&MetaEvent], event_file: &st
|
||||
if !expected_events[idx].match_with_json_event(e) {
|
||||
eprintln!(
|
||||
"\n\n==== Start 'check_sequential_events_exact' failed ==== \
|
||||
\n\nexpected_events={:?}\nactual_events={:?} \
|
||||
\n\nexpected_events={expected_events:?}\nactual_events={json_events:?} \
|
||||
\n\n==== End 'check_sequential_events_exact' failed ====",
|
||||
expected_events, json_events,
|
||||
);
|
||||
|
||||
return false;
|
||||
@@ -959,9 +957,8 @@ fn check_latest_events_exact(latest_events: &[&MetaEvent], event_file: &str) ->
|
||||
if !latest_events[idx].match_with_json_event(e) {
|
||||
eprintln!(
|
||||
"\n\n==== Start 'check_latest_events_exact' failed ==== \
|
||||
\n\nexpected_events={:?}\nactual_events={:?} \
|
||||
\n\nexpected_events={latest_events:?}\nactual_events={json_events:?} \
|
||||
\n\n==== End 'check_latest_events_exact' failed ====",
|
||||
latest_events, json_events,
|
||||
);
|
||||
|
||||
return false;
|
||||
@@ -5225,7 +5222,7 @@ mod common_parallel {
|
||||
if landlock_enabled {
|
||||
cmd.args(["--landlock"]).args([
|
||||
"--landlock-rules",
|
||||
format!("path={:?},access=rw", blk_file_path).as_str(),
|
||||
format!("path={blk_file_path:?},access=rw").as_str(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -7626,7 +7623,7 @@ mod common_sequential {
|
||||
let mut child = GuestCommand::new(&guest)
|
||||
.args(["--api-socket", &api_socket_source])
|
||||
.args(["--event-monitor", format!("path={event_path}").as_str()])
|
||||
.args(["--cpus", format!("boot={}", n_cpu).as_str()])
|
||||
.args(["--cpus", format!("boot={n_cpu}").as_str()])
|
||||
.args(["--memory", "size=1G"])
|
||||
.args(["--kernel", kernel_path.to_str().unwrap()])
|
||||
.args([
|
||||
@@ -7826,13 +7823,13 @@ mod common_sequential {
|
||||
|
||||
let mut child = GuestCommand::new(&guest)
|
||||
.args(["--api-socket", &api_socket_source])
|
||||
.args(["--event-monitor", format!("path={}", event_path).as_str()])
|
||||
.args(["--event-monitor", format!("path={event_path}").as_str()])
|
||||
.args(["--cpus", "boot=2"])
|
||||
.args(["--memory", "size=1G"])
|
||||
.args(["--kernel", kernel_path.to_str().unwrap()])
|
||||
.default_disks()
|
||||
.default_net()
|
||||
.args(["--vsock", format!("cid=3,socket={}", socket).as_str()])
|
||||
.args(["--vsock", format!("cid=3,socket={socket}").as_str()])
|
||||
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||
.args(device_params)
|
||||
.capture_output()
|
||||
@@ -10355,9 +10352,9 @@ mod live_migration {
|
||||
// Start the 'receive-migration' command on the destination
|
||||
let mut receive_migration = Command::new(clh_command("ch-remote"))
|
||||
.args([
|
||||
&format!("--api-socket={}", dest_api_socket),
|
||||
&format!("--api-socket={dest_api_socket}"),
|
||||
"receive-migration",
|
||||
&format!("tcp:0.0.0.0:{}", migration_port),
|
||||
&format!("tcp:0.0.0.0:{migration_port}"),
|
||||
])
|
||||
.stdin(Stdio::null())
|
||||
.stderr(Stdio::piped())
|
||||
@@ -10371,9 +10368,9 @@ mod live_migration {
|
||||
// Start the 'send-migration' command on the source
|
||||
let mut send_migration = Command::new(clh_command("ch-remote"))
|
||||
.args([
|
||||
&format!("--api-socket={}", src_api_socket),
|
||||
&format!("--api-socket={src_api_socket}"),
|
||||
"send-migration",
|
||||
&format!("tcp:{}:{}", host_ip, migration_port),
|
||||
&format!("tcp:{host_ip}:{migration_port}"),
|
||||
])
|
||||
.stdin(Stdio::null())
|
||||
.stderr(Stdio::piped())
|
||||
@@ -10452,7 +10449,7 @@ mod live_migration {
|
||||
src_vm_cmd
|
||||
.args([
|
||||
"--cpus",
|
||||
format!("boot={},max={}", boot_vcpus, max_vcpus).as_str(),
|
||||
format!("boot={boot_vcpus},max={max_vcpus}").as_str(),
|
||||
])
|
||||
.args(memory_param)
|
||||
.args(["--kernel", kernel_path.to_str().unwrap()])
|
||||
@@ -10957,7 +10954,7 @@ mod rate_limiter {
|
||||
let test_img_path = String::from(
|
||||
test_img_dir
|
||||
.as_path()
|
||||
.join(format!("blk{}.img", i))
|
||||
.join(format!("blk{i}.img"))
|
||||
.to_str()
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user