Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix: Make code compile without `concurrent` feature (#1140)

Michael Schmidt5a70b9b69f9f
diff --git a/harper-core/src/patterns/mod.rs b/harper-core/src/patterns/mod.rs
index db16f6682..3ef9ee30c 100644
--- a/harper-core/src/patterns/mod.rs
+++ b/harper-core/src/patterns/mod.rs
@@ -55,8 +55,16 @@ pub use whitespace_pattern::WhitespacePattern;
pub use word_pattern_group::WordPatternGroup;
pub use word_set::WordSet;
-#[cfg_attr(feature = "concurrent", blanket(derive(Arc)))]
-#[cfg_attr(not(feature = "concurrent"), blanket(derive(Rc, Arc)))]
+#[cfg(not(feature = "concurrent"))]
+#[blanket(derive(Rc, Arc))]
+pub trait Pattern {
+ /// Check if the pattern matches at the start of the given token slice.
+ ///
+ /// Returns the length of the match if successful, or `None` if not.
+ fn matches(&self, tokens: &[Token], source: &[char]) -> Option<NonZeroUsize>;
+}
+#[cfg(feature = "concurrent")]
+#[blanket(derive(Arc))]
pub trait Pattern: Send + Sync {
/// Check if the pattern matches at the start of the given token slice.
///