rpm-ostree/backport-0001-rust-treefile-Fix-has_modules_enable-check.patch
chenmaodong 593733d119 rust/treefile: Fix has_modules_enable check
Signed-off-by: chenmaodong <chenmaodong@xfusion.com>
2022-12-29 17:34:02 +08:00

27 lines
776 B
Diff

From 0b2f5f0533def11cf38c6b86b7ee6b10aa28123c Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Thu, 21 Apr 2022 13:06:20 -0400
Subject: [PATCH] rust/treefile: Fix has_modules_enable() check
We need to check that the set is actually non-empty.
---
rust/src/treefile.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/src/treefile.rs b/rust/src/treefile.rs
index dfc8fbc0..884e33f7 100644
--- a/rust/src/treefile.rs
+++ b/rust/src/treefile.rs
@@ -863,7 +863,7 @@ impl Treefile {
self.parsed
.modules
.as_ref()
- .map(|m| m.enable.is_some())
+ .map(|m| m.enable.as_ref().map(|e| !e.is_empty()).unwrap_or_default())
.unwrap_or_default()
}
--
2.21.0