public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-comp 3/3] apt package manager: use a `Box` for `Package` enum variant
Date: Tue, 14 Jan 2025 10:09:40 +0100	[thread overview]
Message-ID: <20250114090940.29366-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20250114090940.29366-1-s.sterz@proxmox.com>

otherwise there is a large size difference between different enum
members. this fixes the clippy lint `large_enum_variant` [1].

[1]:
https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/apt_package_manager.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/apt_package_manager.rs b/src/apt_package_manager.rs
index 18454ed..ae1cd01 100644
--- a/src/apt_package_manager.rs
+++ b/src/apt_package_manager.rs
@@ -68,7 +68,7 @@ struct OriginInfo {
 enum TreeEntry {
     Root(Key),
     Origin(OriginInfo),
-    Package(Key, APTUpdateInfo),
+    Package(Key, Box<APTUpdateInfo>),
 }
 
 impl ExtractPrimaryKey for TreeEntry {
@@ -119,7 +119,7 @@ fn update_list_to_tree(updates: &[APTUpdateInfo]) -> SlabTree<TreeEntry> {
         for package in package_list.into_iter() {
             origin_node.append(TreeEntry::Package(
                 Key::from(package.package.clone()),
-                package,
+                Box::new(package),
             ));
         }
     }
-- 
2.39.5



_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel


  parent reply	other threads:[~2025-01-14  9:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14  9:09 [yew-devel] [PATCH yew-comp 1/3] tree wide: switch from `Into` to `From` implementations where possible Shannon Sterz
2025-01-14  9:09 ` [yew-devel] [PATCH yew-comp 2/3] tree wide: implement `Default` for `new()` functions without parameter Shannon Sterz
2025-01-14  9:24   ` [yew-devel] applied: " Dietmar Maurer
2025-01-14  9:09 ` Shannon Sterz [this message]
2025-01-14  9:24   ` [yew-devel] applied: [PATCH yew-comp 3/3] apt package manager: use a `Box` for `Package` enum variant Dietmar Maurer
2025-01-14  9:22 ` [yew-devel] applied: [PATCH yew-comp 1/3] tree wide: switch from `Into` to `From` implementations where possible Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250114090940.29366-3-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=yew-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal