aboutsummaryrefslogtreecommitdiffstats
path: root/src/run/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/run/mod.rs')
-rw-r--r--src/run/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/run/mod.rs b/src/run/mod.rs
index 009954b..c730272 100644
--- a/src/run/mod.rs
+++ b/src/run/mod.rs
@@ -457,8 +457,9 @@ impl Executor {
) -> SpawnedCmd {
for branch in c.branches.into_iter() {
// TODO: do not compile every time
- let compiled = branch.pattern.compile();
- if compiled.matches(&c.discriminant) {
+ if let Ok(compiled) = branch.pattern.try_compile()
+ && compiled.matches(&c.discriminant)
+ {
return self.execute_block(branch.block, stdin, stdout);
}
}