[pve-devel] [PATCH v2 proxmox stable-2 2/2] apt: repos: Remove unneeded unwrap for codename variant

Christian Ebner c.ebner at proxmox.com
Tue Feb 6 10:51:01 CET 2024


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 at 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





More information about the pve-devel mailing list