Mercurial > hg
comparison rust/rhg/src/blackbox.rs @ 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 |
comparison
equal
deleted
inserted
replaced
50765:7f8f6fe13fa9 | 50766:58aa5ee9c846 |
---|---|
45 pub fn new( | 45 pub fn new( |
46 invocation: &'a CliInvocation<'a>, | 46 invocation: &'a CliInvocation<'a>, |
47 process_start_time: &'a ProcessStartTime, | 47 process_start_time: &'a ProcessStartTime, |
48 ) -> Result<Self, HgError> { | 48 ) -> Result<Self, HgError> { |
49 let configured = if let Ok(repo) = invocation.repo { | 49 let configured = if let Ok(repo) = invocation.repo { |
50 if invocation.config.get(b"extensions", b"blackbox").is_none() { | 50 if !invocation.config.is_extension_enabled(b"blackbox") { |
51 // The extension is not enabled | |
52 None | 51 None |
53 } else { | 52 } else { |
54 Some(ConfiguredBlackbox { | 53 Some(ConfiguredBlackbox { |
55 repo, | 54 repo, |
56 max_size: invocation | 55 max_size: invocation |