[pve-devel] [PATCH installer v3 1/2] tree-wide: run rustfmt, fix clippy warnings

Christoph Heiss c.heiss at proxmox.com
Thu Nov 14 15:15:27 CET 2024


No functional changes.

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v1 -> v2:
  * no changes

Changes v2 -> v3:
  * rebased on latest master, mostly new (mechanical) changes

 proxmox-auto-install-assistant/src/main.rs   | 4 ++--
 proxmox-auto-installer/tests/parse-answer.rs | 2 +-
 proxmox-installer-common/src/setup.rs        | 5 ++++-
 proxmox-tui-installer/src/views/mod.rs       | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/proxmox-auto-install-assistant/src/main.rs b/proxmox-auto-install-assistant/src/main.rs
index bc7d5d8..da1ebda 100644
--- a/proxmox-auto-install-assistant/src/main.rs
+++ b/proxmox-auto-install-assistant/src/main.rs
@@ -474,7 +474,7 @@ fn get_disks() -> Result<BTreeMap<String, BTreeMap<String, String>>> {
             }
         }
 
-        let output = match get_udev_properties(&entry.path()) {
+        let output = match get_udev_properties(entry.path()) {
             Ok(output) => output,
             Err(err) => {
                 eprint!("{err}");
@@ -522,7 +522,7 @@ fn get_nics() -> Result<BTreeMap<String, BTreeMap<String, String>>> {
     for link in links {
         let path = format!("/sys/class/net/{link}");
 
-        let output = match get_udev_properties(&PathBuf::from(path)) {
+        let output = match get_udev_properties(PathBuf::from(path)) {
             Ok(output) => output,
             Err(err) => {
                 eprint!("{err}");
diff --git a/proxmox-auto-installer/tests/parse-answer.rs b/proxmox-auto-installer/tests/parse-answer.rs
index 0e5d6e7..65f8c1e 100644
--- a/proxmox-auto-installer/tests/parse-answer.rs
+++ b/proxmox-auto-installer/tests/parse-answer.rs
@@ -50,7 +50,7 @@ pub fn setup_test_basic(path: impl AsRef<Path>) -> (SetupInfo, LocaleInfo, Runti
 fn test_parse_answers() {
     let path = get_test_resource_path().unwrap();
     let (setup_info, locales, runtime_info, udev_info) = setup_test_basic(&path);
-    let mut tests_path = path.clone();
+    let mut tests_path = path;
     tests_path.push("parse_answer");
     let test_dir = fs::read_dir(tests_path.clone()).unwrap();
 
diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index cd1e8b4..79b17ed 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -12,7 +12,10 @@ use std::{
 use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
 
 use crate::{
-    options::{BtrfsBootdiskOptions, BtrfsCompressOption, Disk, FsType, ZfsBootdiskOptions, ZfsChecksumOption, ZfsCompressOption},
+    options::{
+        BtrfsBootdiskOptions, BtrfsCompressOption, Disk, FsType, ZfsBootdiskOptions,
+        ZfsChecksumOption, ZfsCompressOption,
+    },
     utils::CidrAddress,
 };
 
diff --git a/proxmox-tui-installer/src/views/mod.rs b/proxmox-tui-installer/src/views/mod.rs
index 673905f..b028543 100644
--- a/proxmox-tui-installer/src/views/mod.rs
+++ b/proxmox-tui-installer/src/views/mod.rs
@@ -182,7 +182,7 @@ impl<T: Copy + ToString + FromStr + PartialOrd> NumericEditView<T> {
     ///
     /// # Arguments
     /// * `content` - New, stringified content for the inner [`EditView`]. Must be a valid value
-    /// according to the containet type `T`.
+    ///               according to the container type `T`.
     fn content_inner(mut self, content: &str) -> Self {
         let mut inner = EditView::new();
         std::mem::swap(self.inner_mut(), &mut inner);
-- 
2.47.0





More information about the pve-devel mailing list