We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b013dad commit 39c193bCopy full SHA for 39c193b
1 file changed
encodings/fsst/src/dfa/mod.rs
@@ -209,15 +209,15 @@ enum LikeKind<'a> {
209
impl<'a> LikeKind<'a> {
210
fn parse(pattern: &'a [u8]) -> Option<Self> {
211
// `prefix%` (including just `%` where prefix is empty)
212
- if let Some(prefix) = pattern.strip_suffix(&[b'%'])
+ if let Some(prefix) = pattern.strip_suffix(b"%")
213
&& !prefix.contains(&b'%')
214
&& !prefix.contains(&b'_')
215
{
216
return Some(LikeKind::Prefix(prefix));
217
}
218
219
// `%needle%`
220
- let inner = pattern.strip_prefix(&[b'%'])?.strip_suffix(&[b'%'])?;
+ let inner = pattern.strip_prefix(b"%")?.strip_suffix(b"%")?;
221
if !inner.contains(&b'%') && !inner.contains(&b'_') {
222
return Some(LikeKind::Contains(inner));
223
0 commit comments