From 15cdc64869ea5508d96a0e7667c44c7c459986a1 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 27 Aug 2023 16:38:25 -0400 Subject: [PATCH] cli: remove use of deprecated API I deprecated this API a couple releases ago. Update the `regex-cli` tool to be in line with that. --- regex-cli/args/thompson.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/regex-cli/args/thompson.rs b/regex-cli/args/thompson.rs index 6e7b4afd8..151fc6a0b 100644 --- a/regex-cli/args/thompson.rs +++ b/regex-cli/args/thompson.rs @@ -28,7 +28,11 @@ impl Config { pub fn reversed(&self) -> Config { // Reverse DFAs require that captures are disabled. In practice, there // is no current use case for a reverse NFA with capture groups. - let thompson = self.thompson.clone().reverse(true).captures(false); + let thompson = self + .thompson + .clone() + .reverse(true) + .which_captures(thompson::WhichCaptures::None); Config { thompson } } @@ -67,7 +71,10 @@ impl Configurable for Config { self.thompson = self.thompson.clone().shrink(true); } Arg::Long("no-captures") => { - self.thompson = self.thompson.clone().captures(false); + self.thompson = self + .thompson + .clone() + .which_captures(thompson::WhichCaptures::None); } Arg::Long("line-terminator") => { let byte: flags::OneByte =