From 991ba8836b3dea741bdcb4e6f680543ab10331d6 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 24 Oct 2024 09:58:32 -0400 Subject: [PATCH] unstable: fix `Pattern` trait implementation I am teetering on removing this cursed implementation. Fixes #1231 --- src/pattern.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pattern.rs b/src/pattern.rs index 5c4260e95..d7bf148d5 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -1,4 +1,4 @@ -use core::str::pattern::{Pattern, SearchStep, Searcher}; +use core::str::pattern::{Pattern, SearchStep, Searcher, Utf8Pattern}; use crate::{Matches, Regex}; @@ -21,6 +21,10 @@ impl<'r> Pattern for &'r Regex { next_match: None, } } + + fn as_utf8_pattern<'p>(&'p self) -> Option> { + None + } } unsafe impl<'r, 't> Searcher<'t> for RegexSearcher<'r, 't> {