* [pve-devel] [PATCH installer 0/2] rustfmt & clippy warning fix
@ 2023-11-03 9:49 Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 1/2] tui, common: run rustfmt Christoph Heiss
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christoph Heiss @ 2023-11-03 9:49 UTC (permalink / raw)
To: pve-devel
First patch is just a mechanical rustfmt, which I apparently missed to
check during review - that's on me. Second patch fixes a longer-standing
clippy warning.
Christoph Heiss (2):
tui, common: run rustfmt
tui: fix clippy warning
proxmox-installer-common/src/setup.rs | 1 -
proxmox-tui-installer/src/main.rs | 2 +-
proxmox-tui-installer/src/options.rs | 12 ++++++------
proxmox-tui-installer/src/setup.rs | 14 +++++---------
proxmox-tui-installer/src/views/bootdisk.rs | 10 ++++++----
proxmox-tui-installer/src/views/timezone.rs | 4 +---
proxmox-tui-installer/rustfmt.toml => rustfmt.toml | 0
7 files changed, 19 insertions(+), 24 deletions(-)
rename proxmox-tui-installer/rustfmt.toml => rustfmt.toml (100%)
--
2.42.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH installer 1/2] tui, common: run rustfmt
2023-11-03 9:49 [pve-devel] [PATCH installer 0/2] rustfmt & clippy warning fix Christoph Heiss
@ 2023-11-03 9:49 ` Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 2/2] tui: fix clippy warning Christoph Heiss
2023-11-03 11:53 ` [pve-devel] applied: [PATCH installer 0/2] rustfmt & clippy warning fix Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Heiss @ 2023-11-03 9:49 UTC (permalink / raw)
To: pve-devel
While at it, move rustfmt.toml to the repo root, to share it with the
other crate.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
proxmox-installer-common/src/setup.rs | 1 -
proxmox-tui-installer/src/options.rs | 12 ++++++------
proxmox-tui-installer/src/setup.rs | 14 +++++---------
proxmox-tui-installer/src/views/bootdisk.rs | 10 ++++++----
proxmox-tui-installer/src/views/timezone.rs | 4 +---
proxmox-tui-installer/rustfmt.toml => rustfmt.toml | 0
6 files changed, 18 insertions(+), 23 deletions(-)
rename proxmox-tui-installer/rustfmt.toml => rustfmt.toml (100%)
diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index 3ef05ae..42a9e68 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -365,4 +365,3 @@ impl Interface {
format!("{} {}", self.state.render(), self.name)
}
}
-
diff --git a/proxmox-tui-installer/src/options.rs b/proxmox-tui-installer/src/options.rs
index 221ad01..8ea7043 100644
--- a/proxmox-tui-installer/src/options.rs
+++ b/proxmox-tui-installer/src/options.rs
@@ -1,11 +1,11 @@
use crate::SummaryOption;
use proxmox_installer_common::{
- setup::LocaleInfo,
options::{
- BootdiskOptions, BtrfsRaidLevel, FsType, NetworkOptions, TimezoneOptions,
- PasswordOptions, ZfsRaidLevel,
+ BootdiskOptions, BtrfsRaidLevel, FsType, NetworkOptions, PasswordOptions, TimezoneOptions,
+ ZfsRaidLevel,
},
+ setup::LocaleInfo,
};
pub const FS_TYPES: &[FsType] = {
@@ -70,13 +70,13 @@ mod tests {
use super::*;
use proxmox_installer_common::{
setup::{
- Dns, Gateway, Interface, InterfaceState, IsoInfo, IsoLocations, NetworkInfo, ProductConfig,
- ProxmoxProduct, Routes, SetupInfo,
+ Dns, Gateway, Interface, InterfaceState, IsoInfo, IsoLocations, NetworkInfo,
+ ProductConfig, ProxmoxProduct, Routes, SetupInfo,
},
utils::{CidrAddress, Fqdn},
};
- use std::{collections::HashMap, path::PathBuf};
use std::net::{IpAddr, Ipv4Addr};
+ use std::{collections::HashMap, path::PathBuf};
fn dummy_setup_info() -> SetupInfo {
SetupInfo {
diff --git a/proxmox-tui-installer/src/setup.rs b/proxmox-tui-installer/src/setup.rs
index efcabed..79421d7 100644
--- a/proxmox-tui-installer/src/setup.rs
+++ b/proxmox-tui-installer/src/setup.rs
@@ -1,17 +1,13 @@
-use std::{
- collections::HashMap,
- fmt,
- net::IpAddr,
-};
+use std::{collections::HashMap, fmt, net::IpAddr};
use serde::{Serialize, Serializer};
use crate::options::InstallerOptions;
use proxmox_installer_common::{
- options::{AdvancedBootdiskOptions, BtrfsRaidLevel, Disk, FsType, ZfsRaidLevel},
- setup::InstallZfsOption,
- utils::CidrAddress,
- };
+ options::{AdvancedBootdiskOptions, BtrfsRaidLevel, Disk, FsType, ZfsRaidLevel},
+ setup::InstallZfsOption,
+ utils::CidrAddress,
+};
/// See Proxmox::Install::Config
#[derive(Serialize)]
diff --git a/proxmox-tui-installer/src/views/bootdisk.rs b/proxmox-tui-installer/src/views/bootdisk.rs
index 38a6521..7cc7678 100644
--- a/proxmox-tui-installer/src/views/bootdisk.rs
+++ b/proxmox-tui-installer/src/views/bootdisk.rs
@@ -14,13 +14,15 @@ use crate::options::FS_TYPES;
use crate::InstallerState;
use proxmox_installer_common::{
+ disk_checks::{
+ check_btrfs_raid_config, check_disks_4kn_legacy_boot, check_for_duplicate_disks,
+ check_zfs_raid_config,
+ },
options::{
- AdvancedBootdiskOptions, BootdiskOptions, BtrfsBootdiskOptions, Disk,
- FsType, LvmBootdiskOptions, ZfsBootdiskOptions,
- ZFS_CHECKSUM_OPTIONS, ZFS_COMPRESS_OPTIONS,
+ AdvancedBootdiskOptions, BootdiskOptions, BtrfsBootdiskOptions, Disk, FsType,
+ LvmBootdiskOptions, ZfsBootdiskOptions, ZFS_CHECKSUM_OPTIONS, ZFS_COMPRESS_OPTIONS,
},
setup::{BootType, ProductConfig, ProxmoxProduct},
- disk_checks::{check_btrfs_raid_config, check_for_duplicate_disks, check_disks_4kn_legacy_boot, check_zfs_raid_config},
};
pub struct BootdiskOptionsView {
diff --git a/proxmox-tui-installer/src/views/timezone.rs b/proxmox-tui-installer/src/views/timezone.rs
index 77fbb10..deda600 100644
--- a/proxmox-tui-installer/src/views/timezone.rs
+++ b/proxmox-tui-installer/src/views/timezone.rs
@@ -5,9 +5,7 @@ use cursive::{
};
use super::FormView;
-use crate::{
- system, InstallerState,
-};
+use crate::{system, InstallerState};
use proxmox_installer_common::{
options::TimezoneOptions,
setup::{KeyboardMapping, LocaleInfo},
diff --git a/proxmox-tui-installer/rustfmt.toml b/rustfmt.toml
similarity index 100%
rename from proxmox-tui-installer/rustfmt.toml
rename to rustfmt.toml
--
2.42.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH installer 2/2] tui: fix clippy warning
2023-11-03 9:49 [pve-devel] [PATCH installer 0/2] rustfmt & clippy warning fix Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 1/2] tui, common: run rustfmt Christoph Heiss
@ 2023-11-03 9:49 ` Christoph Heiss
2023-11-03 11:53 ` [pve-devel] applied: [PATCH installer 0/2] rustfmt & clippy warning fix Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Heiss @ 2023-11-03 9:49 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
proxmox-tui-installer/src/main.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/proxmox-tui-installer/src/main.rs b/proxmox-tui-installer/src/main.rs
index 3216868..2e5a194 100644
--- a/proxmox-tui-installer/src/main.rs
+++ b/proxmox-tui-installer/src/main.rs
@@ -505,7 +505,7 @@ fn network_dialog(siv: &mut Cursive) -> InstallerView {
ifaces_selection.set_selection(
ifnames
.clone()
- .position(|iface| &iface.1 == &options.ifname)
+ .position(|iface| iface.1 == options.ifname)
.unwrap_or(ifaces.len() - 1),
);
--
2.42.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied: [PATCH installer 0/2] rustfmt & clippy warning fix
2023-11-03 9:49 [pve-devel] [PATCH installer 0/2] rustfmt & clippy warning fix Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 1/2] tui, common: run rustfmt Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 2/2] tui: fix clippy warning Christoph Heiss
@ 2023-11-03 11:53 ` Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-11-03 11:53 UTC (permalink / raw)
To: Proxmox VE development discussion, Christoph Heiss
On 03/11/2023 10:49, Christoph Heiss wrote:
> First patch is just a mechanical rustfmt, which I apparently missed to
> check during review - that's on me. Second patch fixes a longer-standing
> clippy warning.
>
> Christoph Heiss (2):
> tui, common: run rustfmt
> tui: fix clippy warning
>
> proxmox-installer-common/src/setup.rs | 1 -
> proxmox-tui-installer/src/main.rs | 2 +-
> proxmox-tui-installer/src/options.rs | 12 ++++++------
> proxmox-tui-installer/src/setup.rs | 14 +++++---------
> proxmox-tui-installer/src/views/bootdisk.rs | 10 ++++++----
> proxmox-tui-installer/src/views/timezone.rs | 4 +---
> proxmox-tui-installer/rustfmt.toml => rustfmt.toml | 0
> 7 files changed, 19 insertions(+), 24 deletions(-)
> rename proxmox-tui-installer/rustfmt.toml => rustfmt.toml (100%)
>
> --
> 2.42.0
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-03 11:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-03 9:49 [pve-devel] [PATCH installer 0/2] rustfmt & clippy warning fix Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 1/2] tui, common: run rustfmt Christoph Heiss
2023-11-03 9:49 ` [pve-devel] [PATCH installer 2/2] tui: fix clippy warning Christoph Heiss
2023-11-03 11:53 ` [pve-devel] applied: [PATCH installer 0/2] rustfmt & clippy warning fix Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.