changeset 50766:58aa5ee9c846

rust-blackbox: use `is_extension_enabled` config helper It's there, may as well use it to make the code clearer and less bug-prone.
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 06 Jul 2023 11:17:55 +0200
parents 7f8f6fe13fa9
children 50334ab5e5bb
files rust/rhg/src/blackbox.rs
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/rhg/src/blackbox.rs	Wed Jul 05 23:59:22 2023 +0200
+++ b/rust/rhg/src/blackbox.rs	Thu Jul 06 11:17:55 2023 +0200
@@ -47,8 +47,7 @@
         process_start_time: &'a ProcessStartTime,
     ) -> Result<Self, HgError> {
         let configured = if let Ok(repo) = invocation.repo {
-            if invocation.config.get(b"extensions", b"blackbox").is_none() {
-                // The extension is not enabled
+            if !invocation.config.is_extension_enabled(b"blackbox") {
                 None
             } else {
                 Some(ConfiguredBlackbox {