Skip to content

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

fix(core): seal trait

Elijah Potter5c09e09c10bb
diff --git a/harper-core/src/char_string.rs b/harper-core/src/char_string.rs
index b7e8b192a..d3e956c07 100644
--- a/harper-core/src/char_string.rs
+++ b/harper-core/src/char_string.rs
@@ -7,8 +7,14 @@ use smallvec::SmallVec;
/// Most English words are fewer than 12 characters.
pub type CharString = SmallVec<[char; 16]>;
+mod private {
+ pub trait Sealed {}
+
+ impl Sealed for [char] {}
+}
+
/// Extensions to character sequences that make them easier to wrangle.
-pub trait CharStringExt {
+pub trait CharStringExt: private::Sealed {
/// Convert all characters to lowercase, returning a new owned vector if any changes were made.
fn to_lower(&'_ self) -> Cow<'_, [char]>;