public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 proxmox stable-2 2/2] apt: repos: Remove unneeded unwrap for codename variant
Date: Tue,  6 Feb 2024 10:51:01 +0100	[thread overview]
Message-ID: <20240206095101.89765-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20240206095101.89765-1-c.ebner@proxmox.com>

The call to next now does not return an Option, but rahter contains a
dedicated Unknown variant. Therefore the unwrap call can be avoided and
the panic to calls to `pveversion` when /etc/os-release contained
`VERSION_CODENAME=trixie` can be avoided.

Reported in the community forum:
https://forum.proxmox.com/threads/141004/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
Changes since v1:
- No changes

 proxmox-apt/src/repositories/mod.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/proxmox-apt/src/repositories/mod.rs b/proxmox-apt/src/repositories/mod.rs
index 6588b90..ccb49cd 100644
--- a/proxmox-apt/src/repositories/mod.rs
+++ b/proxmox-apt/src/repositories/mod.rs
@@ -110,8 +110,9 @@ pub fn standard_repositories(
                     || repo.is_referenced_repository(
                         entry.handle,
                         product,
-                        &suite.next().unwrap().to_string(),
-                ) {
+                        &suite.next().to_string(),
+                    )
+                {
                     entry.status = Some(repo.enabled);
                 }
             }
-- 
2.30.2





      reply	other threads:[~2024-02-06  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06  9:51 [pve-devel] [PATCH v2 proxmox master stable-2 1/2] apt: repos: extend `DebianCodename` by `Unknown` variant Christian Ebner
2024-02-06  9:51 ` Christian Ebner [this message]

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=20240206095101.89765-2-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pve-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