mirror of
https://github.com/Automattic/harper.git
synced 2025-12-23 08:48:15 +00:00
fix(core): seal trait
This commit is contained in:
parent
f15778ed28
commit
5c09e09c10
1 changed files with 7 additions and 1 deletions
|
|
@ -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]>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue