Skip to content

Commit 1664214

Browse files
authored
Minor: make it clear Predicate is crate private (#7001)
1 parent 6fd4607 commit 1664214

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arrow-string/src/predicate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use regex::{Regex, RegexBuilder};
2424
use std::iter::zip;
2525

2626
/// A string based predicate
27-
pub enum Predicate<'a> {
27+
pub(crate) enum Predicate<'a> {
2828
Eq(&'a str),
2929
Contains(Finder<'a>),
3030
StartsWith(&'a str),
@@ -42,7 +42,7 @@ pub enum Predicate<'a> {
4242

4343
impl<'a> Predicate<'a> {
4444
/// Create a predicate for the given like pattern
45-
pub fn like(pattern: &'a str) -> Result<Self, ArrowError> {
45+
pub(crate) fn like(pattern: &'a str) -> Result<Self, ArrowError> {
4646
if !contains_like_pattern(pattern) {
4747
Ok(Self::Eq(pattern))
4848
} else if pattern.ends_with('%') && !contains_like_pattern(&pattern[..pattern.len() - 1]) {
@@ -59,12 +59,12 @@ impl<'a> Predicate<'a> {
5959
}
6060
}
6161

62-
pub fn contains(needle: &'a str) -> Self {
62+
pub(crate) fn contains(needle: &'a str) -> Self {
6363
Self::Contains(Finder::new(needle.as_bytes()))
6464
}
6565

6666
/// Create a predicate for the given ilike pattern
67-
pub fn ilike(pattern: &'a str, is_ascii: bool) -> Result<Self, ArrowError> {
67+
pub(crate) fn ilike(pattern: &'a str, is_ascii: bool) -> Result<Self, ArrowError> {
6868
if is_ascii && pattern.is_ascii() {
6969
if !contains_like_pattern(pattern) {
7070
return Ok(Self::IEqAscii(pattern));
@@ -81,7 +81,7 @@ impl<'a> Predicate<'a> {
8181
}
8282

8383
/// Evaluate this predicate against the given haystack
84-
pub fn evaluate(&self, haystack: &str) -> bool {
84+
pub(crate) fn evaluate(&self, haystack: &str) -> bool {
8585
match self {
8686
Predicate::Eq(v) => *v == haystack,
8787
Predicate::IEqAscii(v) => haystack.eq_ignore_ascii_case(v),
@@ -100,7 +100,7 @@ impl<'a> Predicate<'a> {
100100
///
101101
/// If `negate` is true the result of the predicate will be negated
102102
#[inline(never)]
103-
pub fn evaluate_array<'i, T>(&self, array: T, negate: bool) -> BooleanArray
103+
pub(crate) fn evaluate_array<'i, T>(&self, array: T, negate: bool) -> BooleanArray
104104
where
105105
T: ArrayAccessor<Item = &'i str>,
106106
{

0 commit comments

Comments
 (0)