]> git.proxmox.com Git - ui/proxmox-yew-comp.git/commitdiff
tree wide: remove deref ref patterns where possible
authorShannon Sterz <s.sterz@proxmox.com>
Fri, 27 Dec 2024 09:21:24 +0000 (10:21 +0100)
committerShannon Sterz <s.sterz@proxmox.com>
Tue, 7 Jan 2025 09:08:29 +0000 (10:08 +0100)
just reborrow in these case, this fixes the clippy lint
`borrow_deref_ref` [1].

[1]: https://rust-lang.github.io/rust-clippy/master/#borrow_deref_ref

src/acme/acme_accounts.rs
src/acme/acme_domains.rs
src/acme/acme_plugins.rs
src/object_grid.rs

index e2203882cb8d94af6cfeca115787c2c3891c1c6c..19bf48bf836a91c89528b362d5e48c3a14673e5a 100644 (file)
@@ -131,7 +131,7 @@ impl LoadableComponent for ProxmoxAcmeAccountsPanel {
                             if let Some(selected_key) = &selected_key {
                                 let command_path = format!(
                                     "/config/acme/account/{}",
-                                    percent_encode_component(&*selected_key)
+                                    percent_encode_component(selected_key)
                                 );
                                 let command_future =
                                     crate::http_delete_get::<String>(command_path, None);
@@ -181,7 +181,7 @@ impl LoadableComponent for ProxmoxAcmeAccountsPanel {
                     .into(),
             ),
             ViewState::View(account_name) => {
-                Some(self.create_account_view_dialog(ctx, &*account_name))
+                Some(self.create_account_view_dialog(ctx, account_name))
             }
         }
     }
index 60090a124181b509eab7ad2335265fd7c2a9c4ed..189298810c9a92f4d4d12ffa20b1e4a96db719ee 100644 (file)
@@ -270,7 +270,7 @@ impl LoadableComponent for ProxmoxAcmeDomainsPanel {
         match view_state {
             ViewState::Add => Some(self.create_add_acme_domain_dialog(ctx)),
             ViewState::Edit(domain_name) => {
-                Some(self.create_edit_acme_domain_dialog(ctx, &*domain_name))
+                Some(self.create_edit_acme_domain_dialog(ctx, domain_name))
             }
             ViewState::EditAccount => Some(self.create_edit_acme_account_dialog(ctx)),
         }
index 917c2c90c8cac2dda7d53bf1fbb0e4dc9341269b..ef2ab5e2e86c7e47b803dc73d372079adfb39b56 100644 (file)
@@ -236,7 +236,7 @@ impl LoadableComponent for ProxmoxAcmePluginsPanel {
                     let command_path = format!(
                         "{}/{}",
                         ctx.props().url,
-                        percent_encode_component(&*selected_key)
+                        percent_encode_component(selected_key)
                     );
                     let command_future = crate::http_delete(command_path, None);
                     let link = ctx.link().clone();
@@ -314,7 +314,7 @@ impl LoadableComponent for ProxmoxAcmePluginsPanel {
     ) -> Option<Html> {
         match view_state {
             ViewState::Add => Some(self.create_add_dns_plugin_dialog(ctx)),
-            ViewState::Edit(id) => Some(self.create_edit_dns_plugin_dialog(ctx, &*id)),
+            ViewState::Edit(id) => Some(self.create_edit_dns_plugin_dialog(ctx, id)),
         }
     }
 }
index b2c82a70be3f90741e38115ac50d40ebd8ac7e17..d00e8313761cdc0234f49357f23bfc8a70182e40 100644 (file)
@@ -412,7 +412,7 @@ impl LoadableComponent for PwtObjectGrid {
         let props = ctx.props();
 
         let disable_edit = if let Some(key) = &self.selection {
-            let name: &str = &*key;
+            let name: &str = key;
             !self.editors.contains_key(name)
         } else {
             true