summaryrefslogtreecommitdiffstats
path: root/src/print.rs
diff options
context:
space:
mode:
authorNeil Kistner <neil.kistner@gmail.com>2019-09-09 18:14:38 -0500
committerMatan Kushner <hello@matchai.me>2019-09-09 19:14:38 -0400
commit9f70ffb7a7d2eeef64c360c553e909d38e44adf0 (patch)
tree4dccf8a935e027dcf7bc77781eed1554a645d72a /src/print.rs
parentdc8409333e194624896c74c5e5cdb4f664f53f9d (diff)
fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
Diffstat (limited to 'src/print.rs')
-rw-r--r--src/print.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/print.rs b/src/print.rs
index 1ea1648ff..2b730e259 100644
--- a/src/print.rs
+++ b/src/print.rs
@@ -81,6 +81,7 @@ pub fn prompt(args: ArgMatches) {
let modules = &prompt_order
.par_iter()
+ .filter(|module| context.is_module_enabled(module))
.map(|module| modules::handle(module, &context)) // Compute modules
.flatten()
.collect::<Vec<Module>>(); // Remove segments set to `None`