From b8da503500e3ef28833e95976059745c915fb098 Mon Sep 17 00:00:00 2001 From: Kyle Krowpman Date: Thu, 21 Nov 2024 00:42:39 -0800 Subject: [PATCH] remove extra regex --- src/timer.rs | 6 +++--- src/uci.rs | 20 -------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/timer.rs b/src/timer.rs index c0fa6a2..0f73270 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -125,8 +125,8 @@ impl TryFrom<&str> for TimeControl { static GO_RE: LazyLock = LazyLock::new(|| { Regex::new( - r"(?x) - ^go + r"(?x)^ + go (?: \s+depth\s+(?P\d+) | \s+nodes\s+(?P\d+) | @@ -138,7 +138,7 @@ static GO_RE: LazyLock = LazyLock::new(|| { \s+mate\s+(?P\d+) | \s+movestogo\s+(?P\d+) )* - $", + $", ) .expect("Go regex should be valid.") }); diff --git a/src/uci.rs b/src/uci.rs index 86f5ae2..f64a3b4 100644 --- a/src/uci.rs +++ b/src/uci.rs @@ -170,26 +170,6 @@ impl UCICommand { } } -static GO_RE: LazyLock = LazyLock::new(|| { - Regex::new( - r"(?x)^ - go - (?: - \s+depth\s+(?P\d+) | - \s+nodes\s+(?P\d+) | - \s+movetime\s+(?P\d+) | - \s+wtime\s+(?P\d+) | - \s+btime\s+(?P\d+) | - \s+winc\s+(?P\d+) | - \s+binc\s+(?P\d+) | - \s+mate\s+(?P\d+) | - \s+movestogo\s+(?P\d+) - )* - $", - ) - .expect("Failed to compile go regex.") -}); - static POSITION_RE: LazyLock = LazyLock::new(|| { Regex::new( r"(?x)^