Skip to content

Commit 930770b

Browse files
committed
regex: switch RegexSet to use WhichCaptures::None
And this finally resolves the memory usage problem, as the PikeVM cache used by the RegexSet in #1059 no longer allocates MBs of memory because of the existence of impossible-to-use capturing groups. Fixes #1059
1 parent e29b915 commit 930770b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/builders.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl Builder {
107107
.clone()
108108
.match_kind(MatchKind::All)
109109
.utf8_empty(true)
110-
.which_captures(WhichCaptures::Implicit);
110+
.which_captures(WhichCaptures::None);
111111
let syntaxc = self.syntaxc.clone().utf8(true);
112112
let patterns = Arc::from(self.pats.as_slice());
113113
meta::Builder::new()
@@ -124,7 +124,7 @@ impl Builder {
124124
.clone()
125125
.match_kind(MatchKind::All)
126126
.utf8_empty(false)
127-
.which_captures(WhichCaptures::Implicit);
127+
.which_captures(WhichCaptures::None);
128128
let syntaxc = self.syntaxc.clone().utf8(false);
129129
let patterns = Arc::from(self.pats.as_slice());
130130
meta::Builder::new()

0 commit comments

Comments
 (0)