rust-blackbox: use `is_extension_enabled` config helper
authorRaphaël Gomès <rgomes@octobus.net>
Thu, 06 Jul 2023 11:17:55 +0200
changeset 50766 58aa5ee9c846
parent 50765 7f8f6fe13fa9
child 50767 50334ab5e5bb
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.
rust/rhg/src/blackbox.rs
--- 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 {