From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox stable-2 2/2] apt: repos: Remove unneeded unwrap for codename variant
Date: Mon, 5 Feb 2024 18:08:27 +0100 [thread overview]
Message-ID: <20240205170827.340962-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20240205170827.340962-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>
---
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
next prev parent reply other threads:[~2024-02-05 17:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 17:08 [pve-devel] [PATCH proxmox master stable-2 1/2] apt: repos: extend `Codename` by `Unknown` variant Christian Ebner
2024-02-05 17:08 ` Christian Ebner [this message]
2024-02-06 8:29 ` Fiona Ebner
2024-02-06 8:48 ` Christian Ebner
2024-02-06 8:59 ` Fiona Ebner
2024-02-06 9:26 ` Christian Ebner
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=20240205170827.340962-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