From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BDD851FF13E for ; Fri, 06 Mar 2026 12:21:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 538CF1F90E; Fri, 6 Mar 2026 12:22:02 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-comp 08/15] tree wide: fix various minor clippy lints Date: Fri, 6 Mar 2026 12:21:40 +0100 Message-ID: <20260306112148.208189-9-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260306112148.208189-1-s.sterz@proxmox.com> References: <20260306112148.208189-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1772796082727 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.894 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_MAILER 2 Automated Mailer Tag Left in Email RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YHAVWPR6D5IFCGRYEBDX6KO6DXJIVTKL X-Message-ID-Hash: YHAVWPR6D5IFCGRYEBDX6KO6DXJIVTKL X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: such as: * useless_format * unused_unit * too_many_arguments * single_match * search_is_some * redundant_pattern_matching * redundant_guards * redundant_field_names * redundant_closure * partialeq_to_none * needless_return * needless_borrows_for_generic_args * needless_borrow * needless_bool * match_like_matches_macro * map_flatten * manual_map * if_same_then_else * from_over_into * explicit_auto_deref * enum_variant_names * collapsible_if * nonminimal_bool Signed-off-by: Shannon Sterz --- .../pve/firewall/firewall_rules_panel.rs | 2 +- src/configuration/pve/lxc_network_panel.rs | 7 +-- .../pve/lxc_resources_panel/desktop.rs | 2 +- .../pve/lxc_resources_panel/mobile.rs | 2 +- src/configuration/pve/move_disk_dialog.rs | 2 +- .../pve/qemu_hardware_panel/desktop.rs | 2 +- .../pve/qemu_hardware_panel/mobile.rs | 2 +- src/editable_property.rs | 2 +- src/form/pve/boot_device_list.rs | 6 +- .../log_ratelimit_selector.rs | 6 +- src/form/pve/hotplug_feature_selector.rs | 4 +- src/form/pve/lxc_mount_options_selector.rs | 4 +- .../lxc_property/lxc_mount_point_property.rs | 32 ++++------- src/form/pve/pve_guest_selector.rs | 2 +- src/form/pve/pve_network_selector.rs | 5 +- src/form/pve/qemu_cpu_flags_list.rs | 8 +-- .../pve/qemu_disk_size_format_selector.rs | 6 +- .../pve/qemu_property/qemu_disk_property.rs | 55 ++++++++----------- .../qemu_property/qemu_display_property.rs | 2 +- .../pve/qemu_property/qemu_memory_property.rs | 15 +++-- .../qemu_spice_enhancement_property.rs | 4 +- src/log_view.rs | 2 +- src/utils/task_descriptions.rs | 4 +- 23 files changed, 74 insertions(+), 102 deletions(-) diff --git a/src/configuration/pve/firewall/firewall_rules_panel.rs b/src/configuration/pve/firewall/firewall_rules_panel.rs index 56d687e..3f9a9d0 100644 --- a/src/configuration/pve/firewall/firewall_rules_panel.rs +++ b/src/configuration/pve/firewall/firewall_rules_panel.rs @@ -260,7 +260,7 @@ fn render_firewall_rule_mobile(rule: &ListFirewallRules) -> Html { let prefix = Column::new() .gap(1) - .with_child(Container::new().with_child(&rule.pos)) + .with_child(Container::new().with_child(rule.pos)) .with_child(Container::new().with_child(&rule.ty)); tile.add_child(prefix); diff --git a/src/configuration/pve/lxc_network_panel.rs b/src/configuration/pve/lxc_network_panel.rs index ae42ab1..200754d 100644 --- a/src/configuration/pve/lxc_network_panel.rs +++ b/src/configuration/pve/lxc_network_panel.rs @@ -233,10 +233,9 @@ impl LoadableComponent for LxcNetworkComp { move |_| link.change_view(Some(ViewState::Add)) })) .with_child({ - let msg = match &selected_key { - Some(key) => Some(super::guest::confirm_remove_message(&key.to_string())), - None => None, - }; + let msg = selected_key + .as_ref() + .map(|key| super::guest::confirm_remove_message(&key.to_string())); ConfirmButton::new(tr!("Remove")) .disabled(disable_remove) .confirm_message(msg) diff --git a/src/configuration/pve/lxc_resources_panel/desktop.rs b/src/configuration/pve/lxc_resources_panel/desktop.rs index 2b16133..a70840f 100644 --- a/src/configuration/pve/lxc_resources_panel/desktop.rs +++ b/src/configuration/pve/lxc_resources_panel/desktop.rs @@ -167,7 +167,7 @@ impl PveLxcResourcesPanel { Some(Value::String(volume)) => volume.clone(), _ => name.to_string(), }; - confirm_delete_volume(&*name, &volume, false) + confirm_delete_volume(&name, &volume, false) .on_close(on_done) .on_confirm({ let on_confirm = on_confirm.clone(); diff --git a/src/configuration/pve/lxc_resources_panel/mobile.rs b/src/configuration/pve/lxc_resources_panel/mobile.rs index a510565..75c8579 100644 --- a/src/configuration/pve/lxc_resources_panel/mobile.rs +++ b/src/configuration/pve/lxc_resources_panel/mobile.rs @@ -242,7 +242,7 @@ impl PveLxcResourcesPanel { ) -> ListTile { let props = ctx.props(); let menu = self.disk_menu(ctx, name, false, true, false).with_item({ - let volume = record[name].as_str().unwrap_or(&name); + let volume = record[name].as_str().unwrap_or(name); let dialog: Html = confirm_delete_volume(name, volume, true) .on_close({ let link = ctx.link().clone(); diff --git a/src/configuration/pve/move_disk_dialog.rs b/src/configuration/pve/move_disk_dialog.rs index 9cd1bde..57d4549 100644 --- a/src/configuration/pve/move_disk_dialog.rs +++ b/src/configuration/pve/move_disk_dialog.rs @@ -131,7 +131,7 @@ pub fn move_disk_dialog( node: node.clone(), remote: remote.clone(), guest_type, - mobile: mobile, + mobile, }; VComp::new::(Rc::new(props), None).into() } diff --git a/src/configuration/pve/qemu_hardware_panel/desktop.rs b/src/configuration/pve/qemu_hardware_panel/desktop.rs index 4f9b747..1385d9e 100644 --- a/src/configuration/pve/qemu_hardware_panel/desktop.rs +++ b/src/configuration/pve/qemu_hardware_panel/desktop.rs @@ -170,7 +170,7 @@ impl PveQemuHardwarePanel { _ => name.to_string(), }; let on_confirm = on_confirm.clone(); - confirm_delete_volume(&*name, &volume, false) + confirm_delete_volume(&name, &volume, false) .on_close(on_done) .on_confirm(move |_| on_confirm.emit(())) .on_confirm({ diff --git a/src/configuration/pve/qemu_hardware_panel/mobile.rs b/src/configuration/pve/qemu_hardware_panel/mobile.rs index 46b33e4..432ff60 100644 --- a/src/configuration/pve/qemu_hardware_panel/mobile.rs +++ b/src/configuration/pve/qemu_hardware_panel/mobile.rs @@ -379,7 +379,7 @@ impl PveQemuHardwarePanel { ) -> ListTile { let props = ctx.props(); let menu = self.disk_menu(ctx, name, true, false).with_item({ - let volume = record[name].as_str().unwrap_or(&name); + let volume = record[name].as_str().unwrap_or(name); let dialog: Html = confirm_delete_volume(name, volume, true) .on_close({ let link = ctx.link().clone(); diff --git a/src/editable_property.rs b/src/editable_property.rs index b1e124c..dac775a 100644 --- a/src/editable_property.rs +++ b/src/editable_property.rs @@ -135,7 +135,7 @@ impl EditableProperty { pub fn new(name: impl IntoPropValue>, title: impl Into) -> Self { let name = name.into_prop_value(); Self { - name: name, + name, revert_keys: None, title: title.into(), required: false, diff --git a/src/form/pve/boot_device_list.rs b/src/form/pve/boot_device_list.rs index c0d8808..12d9ad7 100644 --- a/src/form/pve/boot_device_list.rs +++ b/src/form/pve/boot_device_list.rs @@ -60,7 +60,7 @@ pub struct PveBootDeviceField { fn add_disabled_devices(list: &mut Vec, boot_devices: &[(String, String)]) { let mut disabled_list = Vec::new(); for (device, value) in boot_devices { - if list.iter().find(|i| &i.name == device).is_none() { + if !list.iter().any(|i| &i.name == device) { disabled_list.push(DeviceEntry { enabled: false, name: device.clone(), @@ -191,9 +191,7 @@ impl ManagedField for PveBootDeviceField { type Properties = BootDeviceList; type ValidateClosure = (); - fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure { - () - } + fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure {} fn validator(_props: &Self::ValidateClosure, value: &Value) -> Result { let value = match value { diff --git a/src/form/pve/firewall_property/log_ratelimit_selector.rs b/src/form/pve/firewall_property/log_ratelimit_selector.rs index 36f92b3..1a9fc51 100644 --- a/src/form/pve/firewall_property/log_ratelimit_selector.rs +++ b/src/form/pve/firewall_property/log_ratelimit_selector.rs @@ -106,9 +106,9 @@ impl Component for LogRatelimitSelectorComp { } } -impl Into for LogRatelimitSelector { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: LogRatelimitSelector) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/form/pve/hotplug_feature_selector.rs b/src/form/pve/hotplug_feature_selector.rs index c0322d0..d16c687 100644 --- a/src/form/pve/hotplug_feature_selector.rs +++ b/src/form/pve/hotplug_feature_selector.rs @@ -125,9 +125,7 @@ impl ManagedField for PveHotplugFeatureMaster { type Properties = HotplugFeatureSelector; type ValidateClosure = (); - fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure { - () - } + fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure {} fn validator(_props: &Self::ValidateClosure, value: &Value) -> Result { let value = match value { diff --git a/src/form/pve/lxc_mount_options_selector.rs b/src/form/pve/lxc_mount_options_selector.rs index 7a8d0a5..19f3dbf 100644 --- a/src/form/pve/lxc_mount_options_selector.rs +++ b/src/form/pve/lxc_mount_options_selector.rs @@ -69,9 +69,7 @@ impl ManagedField for LxcMountOptionsMaster { type Properties = LxcMountOptionsSelector; type ValidateClosure = (); - fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure { - () - } + fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure {} fn validator(_props: &Self::ValidateClosure, value: &Value) -> Result { let value = match value { diff --git a/src/form/pve/lxc_property/lxc_mount_point_property.rs b/src/form/pve/lxc_property/lxc_mount_point_property.rs index f02d84f..36f36a0 100644 --- a/src/form/pve/lxc_property/lxc_mount_point_property.rs +++ b/src/form/pve/lxc_property/lxc_mount_point_property.rs @@ -75,12 +75,11 @@ impl MountPointComp { self.unused_volume = props .unused_disk .as_ref() - .map(|unused_disk| { + .and_then(|unused_disk| { props.state.record[unused_disk] .as_str() .map(|s| s.to_string()) }) - .flatten() .unwrap_or_default(); self.used_mount_points = extract_used_mount_points(&props.state.record); @@ -154,10 +153,8 @@ impl Component for MountPointComp { Some(Value::String(volume)) => { if volume.starts_with("/dev/") { false - } else if volume_storage(volume).is_some() { - false } else { - true + volume_storage(volume).is_none() } } _ => false, @@ -449,17 +446,15 @@ fn mount_point_property( } _ => bail!("got invalid value for unused volume"), } - } else if is_create { - if data[VOLUME_PN].is_null() { - let image_storage = form_ctx.read().get_field_text(IMAGE_STORAGE); - let image_size = - match form_ctx.read().get_last_valid_value(DISK_SIZE_FIELD_NAME) { - Some(Value::Number(size)) => size.as_f64().unwrap(), - _ => bail!("got invalid disk size"), - }; - let image = format!("{image_storage}:{image_size}"); - data[VOLUME_PN] = image.into(); - } + } else if is_create && data[VOLUME_PN].is_null() { + let image_storage = form_ctx.read().get_field_text(IMAGE_STORAGE); + let image_size = + match form_ctx.read().get_last_valid_value(DISK_SIZE_FIELD_NAME) { + Some(Value::Number(size)) => size.as_f64().unwrap(), + _ => bail!("got invalid disk size"), + }; + let image = format!("{image_storage}:{image_size}"); + data[VOLUME_PN] = image.into(); } if let Some((_, _, Some(Value::Bool(no_replicate)))) = form_ctx.read().get_field_data(NOREPLICATE_FIELD_NAME) @@ -586,10 +581,7 @@ fn volume_storage(volume: &str) -> Option { static VOLUME_MATCH: Regex = Regex::new(r#"^([a-zA-Z][a-zA-Z0-9\-_.]*[a-zA-Z0-9]):"#).unwrap(); } match VOLUME_MATCH.with(|r| r.captures(volume)) { - Some(caps) => match caps.get(1) { - Some(storage) => Some(storage.as_str().into()), - None => None, - }, + Some(caps) => caps.get(1).map(|storage| storage.as_str().into()), None => None, } } diff --git a/src/form/pve/pve_guest_selector.rs b/src/form/pve/pve_guest_selector.rs index e1fcf2d..0e9ea76 100644 --- a/src/form/pve/pve_guest_selector.rs +++ b/src/form/pve/pve_guest_selector.rs @@ -103,7 +103,7 @@ impl PveGuestSelectorComp { percent_encode_component(remote), ) } else { - format!("/cluster/resources") + "/cluster/resources".to_string() }; let param = if remote.is_some() { json!({ "kind": ClusterResourceKind::Vm }) diff --git a/src/form/pve/pve_network_selector.rs b/src/form/pve/pve_network_selector.rs index 1c9d170..e555c5d 100644 --- a/src/form/pve/pve_network_selector.rs +++ b/src/form/pve/pve_network_selector.rs @@ -86,10 +86,7 @@ impl PveNetworkSelectorComp { format!("/nodes/{}/network", percent_encode_component(&node)) }; - let param = match ty { - Some(ty) => Some(json!({"type": ty})), - None => None, - }; + let param = ty.map(|ty| json!({"type": ty})); let mut interfaces: Vec = http_get(url, param).await?; interfaces.sort_by(|a, b| a.iface.cmp(&b.iface)); diff --git a/src/form/pve/qemu_cpu_flags_list.rs b/src/form/pve/qemu_cpu_flags_list.rs index becdaf3..048e268 100644 --- a/src/form/pve/qemu_cpu_flags_list.rs +++ b/src/form/pve/qemu_cpu_flags_list.rs @@ -87,9 +87,7 @@ impl ManagedField for QemuCpuFlagsField { type Properties = QemuCpuFlags; type ValidateClosure = (); - fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure { - () - } + fn validation_args(_props: &Self::Properties) -> Self::ValidateClosure {} fn validator(_props: &Self::ValidateClosure, value: &Value) -> Result { Ok(value.clone()) @@ -103,7 +101,7 @@ impl ManagedField for QemuCpuFlagsField { ("spec-ctrl", tr!("Allows improved Spectre mitigation with Intel CPUs")), ("ssbd", tr!("Protection for \"Speculative Store Bypass\" for Intel models")), ("ibpb", tr!("Allows improved Spectre mitigation with AMD CPUs")), - ("virt-ssbd", tr!("Basis for \"Speculative Store Bypass\" protection for AMD models")), + ("virt-ssbd", tr!("Basis for \"Speculative Store Bypass\" protection for AMD models")), ("amd-ssbd", tr!("Improves Spectre mitigation performance with AMD CPUs, best used with \"virt-ssbd\"")), ("amd-no-ssb", tr!("Notifies guest OS that host is not vulnerable for Spectre on AMD CPUs")), ("pdpe1gb", tr!("Allow guest OS to use 1GB size pages, if host HW supports it")), @@ -193,7 +191,7 @@ impl ManagedField for QemuCpuFlagsField { ) .with_child( RadioButton::new("default") - .checked(item.enabled == None) + .checked(item.enabled.is_none()) .on_input(ctx.link().callback({ let name = name.to_string(); move |_| Msg::Set(name.clone(), None) diff --git a/src/form/pve/qemu_disk_size_format_selector.rs b/src/form/pve/qemu_disk_size_format_selector.rs index d981f1c..d689b54 100644 --- a/src/form/pve/qemu_disk_size_format_selector.rs +++ b/src/form/pve/qemu_disk_size_format_selector.rs @@ -178,9 +178,9 @@ impl Component for QemuDiskSizeFormatComp { } } -impl Into for QemuDiskSizeFormatSelector { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: QemuDiskSizeFormatSelector) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/form/pve/qemu_property/qemu_disk_property.rs b/src/form/pve/qemu_property/qemu_disk_property.rs index dfdf9ea..c1df4f3 100644 --- a/src/form/pve/qemu_property/qemu_disk_property.rs +++ b/src/form/pve/qemu_property/qemu_disk_property.rs @@ -112,12 +112,11 @@ impl DiskPanelComp { self.unused_volume = props .unused_disk .as_ref() - .map(|unused_disk| { + .and_then(|unused_disk| { props.state.record[unused_disk] .as_str() .map(|s| s.to_string()) }) - .flatten() .unwrap_or_default(); self.used_devices = extract_used_devices(&props.state.record); @@ -408,13 +407,13 @@ pub fn qemu_disk_property( Some(name) => { if name.starts_with("unused") { let mut title = tr!("Unused Disk"); - if let Some(id) = parse_unused_key(&name) { + if let Some(id) = parse_unused_key(name) { title = title + " " + &id.to_string(); } (Some(name.clone()), title) } else { - (None, tr!("Hard Disk") + " (" + &name + ")") + (None, tr!("Hard Disk") + " (" + name + ")") } } None => (None, tr!("Hard Disk")), @@ -447,11 +446,9 @@ pub fn qemu_disk_property( record[BUS_DEVICE] = default_device.clone().into(); if let Some(name) = &name { - if unused_disk.is_none() { - if !name.starts_with("unused") { - flatten_device_data(&mut record, name)?; - record[BUS_DEVICE] = name.clone().into(); - } + if unused_disk.is_none() && !name.starts_with("unused") { + flatten_device_data(&mut record, name)?; + record[BUS_DEVICE] = name.clone().into(); } } Ok(record) @@ -475,26 +472,24 @@ pub fn qemu_disk_property( } _ => bail!("got invalid value for unused volume"), } - } else if is_create { - if data[FILE_PN].is_null() { - let image_storage = form_ctx.read().get_field_text(IMAGE_STORAGE); - let image_size = match form_ctx - .read() - .get_last_valid_value(QemuDiskSizeFormatSelector::DISK_SIZE) - { - Some(Value::Number(size)) => size.as_f64().unwrap(), - _ => bail!("got invalid disk size"), - }; - let image = format!("{image_storage}:{image_size}"); - data[FILE_PN] = image.into(); + } else if is_create && data[FILE_PN].is_null() { + let image_storage = form_ctx.read().get_field_text(IMAGE_STORAGE); + let image_size = match form_ctx + .read() + .get_last_valid_value(QemuDiskSizeFormatSelector::DISK_SIZE) + { + Some(Value::Number(size)) => size.as_f64().unwrap(), + _ => bail!("got invalid disk size"), + }; + let image = format!("{image_storage}:{image_size}"); + data[FILE_PN] = image.into(); - let image_format = form_ctx - .read() - .get_field_text(QemuDiskSizeFormatSelector::DISK_FORMAT); + let image_format = form_ctx + .read() + .get_field_text(QemuDiskSizeFormatSelector::DISK_FORMAT); - if !image_format.is_empty() { - data["_format"] = Value::String(image_format); - } + if !image_format.is_empty() { + data["_format"] = Value::String(image_format); } } @@ -687,10 +682,8 @@ pub fn qemu_cdrom_property( let form_ctx = state.form_ctx; let image_storage = form_ctx.read().get_field_text(IMAGE_STORAGE); let file = form_ctx.read().get_field_text(FILE_PN); - if !image_storage.is_empty() { - if !file.starts_with(&(image_storage + ":")) { - form_ctx.write().set_field_value(FILE_PN, "".into()); - } + if !image_storage.is_empty() && !file.starts_with(&(image_storage + ":")) { + form_ctx.write().set_field_value(FILE_PN, "".into()); } }) } diff --git a/src/form/pve/qemu_property/qemu_display_property.rs b/src/form/pve/qemu_property/qemu_display_property.rs index 0ba9b4b..a0a216e 100644 --- a/src/form/pve/qemu_property/qemu_display_property.rs +++ b/src/form/pve/qemu_property/qemu_display_property.rs @@ -36,7 +36,7 @@ fn renderer(_name: &str, value: &Value, _record: &Value) -> Html { }; if let Some(QemuConfigVgaClipboard::Vnc) = vga.clipboard { - inner.push(format!("clipboard=vnc")); + inner.push("clipboard=vnc".to_string()); }; if !inner.is_empty() { let inner = inner.join(", "); diff --git a/src/form/pve/qemu_property/qemu_memory_property.rs b/src/form/pve/qemu_property/qemu_memory_property.rs index 9a8d50a..3cda41e 100644 --- a/src/form/pve/qemu_property/qemu_memory_property.rs +++ b/src/form/pve/qemu_property/qemu_memory_property.rs @@ -180,15 +180,14 @@ pub fn qemu_memory_property(mobile: bool) -> EditableProperty { let old_memory = form_ctx.read().get_field_value("_old_memory"); let balloon = form_ctx.read().get_last_valid_value("balloon"); - match (&old_memory, ¤t_memory, &balloon) { - (Some(old_memory), Some(current_memory), Some(balloon)) => { - if balloon == old_memory && old_memory != current_memory { - form_ctx - .write() - .set_field_value("balloon", current_memory.clone()); - } + if let (Some(old_memory), Some(current_memory), Some(balloon)) = + (&old_memory, ¤t_memory, &balloon) + { + if balloon == old_memory && old_memory != current_memory { + form_ctx + .write() + .set_field_value("balloon", current_memory.clone()); } - _ => {} } if let Some(current_memory) = current_memory { diff --git a/src/form/pve/qemu_property/qemu_spice_enhancement_property.rs b/src/form/pve/qemu_property/qemu_spice_enhancement_property.rs index 993fe61..c6be8a7 100644 --- a/src/form/pve/qemu_property/qemu_spice_enhancement_property.rs +++ b/src/form/pve/qemu_property/qemu_spice_enhancement_property.rs @@ -85,9 +85,9 @@ pub fn qemu_spice_enhancement_property(mobile: bool) -> EditableProperty { output.push(tr!("Video Streaming") + ": " + &videostreaming.to_string()); } if output.is_empty() { - return tr!("none").into(); + tr!("none").into() } else { - return output.join(", ").into(); + output.join(", ").into() } } Ok(None::<_>) => tr!("none").into(), diff --git a/src/log_view.rs b/src/log_view.rs index 05acf3d..20f8f77 100644 --- a/src/log_view.rs +++ b/src/log_view.rs @@ -478,7 +478,7 @@ impl Component for PwtLogView { tag.set_style("line-height", format!("{line_height}px")); } - let page_ref = page_ref.take().unwrap_or_else(|| NodeRef::default()); + let page_ref = page_ref.take().unwrap_or_default(); for item in page.lines.iter() { tag.add_child(format!("{}\n", item.t)); diff --git a/src/utils/task_descriptions.rs b/src/utils/task_descriptions.rs index 09156ed..13cb3df 100644 --- a/src/utils/task_descriptions.rs +++ b/src/utils/task_descriptions.rs @@ -364,10 +364,10 @@ fn render_prune_job_worker_id(id: Option, what: &str) -> String { ); } } - return format!( + format!( "{what} on {ds_translated} {id}", ds_translated = tr! {"Datastore"} - ); + ) } proxmox_schema::const_regex! { -- 2.47.3