summaryrefslogtreecommitdiffstats
path: root/crates/regex/src/literal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/regex/src/literal.rs')
-rw-r--r--crates/regex/src/literal.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/regex/src/literal.rs b/crates/regex/src/literal.rs
index 49bc4ca2..f1184fa1 100644
--- a/crates/regex/src/literal.rs
+++ b/crates/regex/src/literal.rs
@@ -141,6 +141,9 @@ impl LiteralSets {
// (Not in theory---it could be better. But the current
// implementation isn't good enough.) ... So we make up for it
// here.
+ if !word {
+ return None;
+ }
let p_min_len = self.prefixes.min_len();
let s_min_len = self.suffixes.min_len();
let lits = match (p_min_len, s_min_len) {