[pve-devel] [PATCH installer 6/6] tree-wide: run cargo fmt
Christoph Heiss
c.heiss at proxmox.com
Thu Nov 13 14:49:54 CET 2025
Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
.../src/bin/proxmox-auto-installer.rs | 7 ++++---
proxmox-auto-installer/src/utils.rs | 15 +++++++++------
proxmox-fetch-answer/src/fetch_plugins/http.rs | 7 ++++---
.../src/fetch_plugins/partition.rs | 7 ++++---
proxmox-tui-installer/src/main.rs | 7 ++++---
5 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/proxmox-auto-installer/src/bin/proxmox-auto-installer.rs b/proxmox-auto-installer/src/bin/proxmox-auto-installer.rs
index 467ef1b..7614fbb 100644
--- a/proxmox-auto-installer/src/bin/proxmox-auto-installer.rs
+++ b/proxmox-auto-installer/src/bin/proxmox-auto-installer.rs
@@ -123,9 +123,10 @@ fn main() -> ExitCode {
};
if answer.global.reboot_on_error
- && let Err(err) = File::create("/run/proxmox-reboot-on-error") {
- error!("failed to create reboot-on-error flag-file: {err}");
- }
+ && let Err(err) = File::create("/run/proxmox-reboot-on-error")
+ {
+ error!("failed to create reboot-on-error flag-file: {err}");
+ }
if answer.global.reboot_mode == RebootMode::PowerOff {
if let Err(err) = File::create("/run/proxmox-poweroff-after-install") {
diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs
index f5c3f70..884a08e 100644
--- a/proxmox-auto-installer/src/utils.rs
+++ b/proxmox-auto-installer/src/utils.rs
@@ -426,9 +426,10 @@ pub fn verify_disks_settings(answer: &Answer) -> Result<()> {
}
if let answer::FsOptions::LVM(lvm) = &answer.disks.fs_options
- && let Some((swapsize, hdsize)) = lvm.swapsize.zip(lvm.hdsize) {
- check_swapsize(swapsize, hdsize)?;
- }
+ && let Some((swapsize, hdsize)) = lvm.swapsize.zip(lvm.hdsize)
+ {
+ check_swapsize(swapsize, hdsize)?;
+ }
Ok(())
}
@@ -437,9 +438,11 @@ pub fn verify_first_boot_settings(answer: &Answer) -> Result<()> {
info!("Verifying first boot settings");
if let Some(first_boot) = &answer.first_boot
- && first_boot.source == FirstBootHookSourceMode::FromUrl && first_boot.url.is_none() {
- bail!("first-boot executable source set to URL, but none specified!");
- }
+ && first_boot.source == FirstBootHookSourceMode::FromUrl
+ && first_boot.url.is_none()
+ {
+ bail!("first-boot executable source set to URL, but none specified!");
+ }
Ok(())
}
diff --git a/proxmox-fetch-answer/src/fetch_plugins/http.rs b/proxmox-fetch-answer/src/fetch_plugins/http.rs
index d6331d8..e2fd633 100644
--- a/proxmox-fetch-answer/src/fetch_plugins/http.rs
+++ b/proxmox-fetch-answer/src/fetch_plugins/http.rs
@@ -140,9 +140,10 @@ impl FetchFromHTTP {
info!("Retrieving default search domain.");
for line in read_to_string("/etc/resolv.conf")?.lines() {
if let Some((key, value)) = line.split_once(' ')
- && key == "search" {
- return Ok(value.trim().into());
- }
+ && key == "search"
+ {
+ return Ok(value.trim().into());
+ }
}
bail!("Could not find search domain in resolv.conf.");
}
diff --git a/proxmox-fetch-answer/src/fetch_plugins/partition.rs b/proxmox-fetch-answer/src/fetch_plugins/partition.rs
index f952513..3eac301 100644
--- a/proxmox-fetch-answer/src/fetch_plugins/partition.rs
+++ b/proxmox-fetch-answer/src/fetch_plugins/partition.rs
@@ -123,9 +123,10 @@ fn check_if_mounted(target_path: &str) -> Result<bool> {
let mounts = fs::read_to_string("/proc/mounts")?;
for line in mounts.lines() {
if let Some(mp) = line.split(' ').nth(1)
- && mp == target_path {
- return Ok(true);
- }
+ && mp == target_path
+ {
+ return Ok(true);
+ }
}
Ok(false)
}
diff --git a/proxmox-tui-installer/src/main.rs b/proxmox-tui-installer/src/main.rs
index 05e6a8e..d2fd3d8 100644
--- a/proxmox-tui-installer/src/main.rs
+++ b/proxmox-tui-installer/src/main.rs
@@ -197,9 +197,10 @@ fn installer_setup_late(siv: &mut Cursive) {
if !state.in_test_mode {
let kmap_id = &state.options.timezone.kb_layout;
if let Some(kmap) = state.locales.kmap.get(kmap_id)
- && let Err(err) = system::set_keyboard_layout(kmap) {
- display_setup_warning(siv, &format!("Failed to apply keyboard layout: {err}"));
- }
+ && let Err(err) = system::set_keyboard_layout(kmap)
+ {
+ display_setup_warning(siv, &format!("Failed to apply keyboard layout: {err}"));
+ }
}
if state.runtime_info.total_memory < 1024 {
--
2.51.0
More information about the pve-devel
mailing list