Skip to content

Commit 27c62ed

Browse files
committed
refactor(cubesql): Fix manual_strip warning
1 parent 71bf87e commit 27c62ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rust/cubesql/cubesql/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ len_zero = "allow"
106106
let_and_return = "allow"
107107
manual_flatten = "allow"
108108
manual_range_contains = "allow"
109-
manual_strip = "allow"
110109
map_clone = "allow"
111110
map_flatten = "allow"
112111
map_identity = "allow"

rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,12 +2780,13 @@ impl FilterRules {
27802780
value.to_string()
27812781
}
27822782
} else if op == "endsWith" || op == "notEndsWith" {
2783-
if value.starts_with("%") {
2784-
let without_wildcard = value[1..].to_string();
2783+
if let Some(without_wildcard) =
2784+
value.strip_prefix("%")
2785+
{
27852786
if without_wildcard.contains("%") {
27862787
continue;
27872788
}
2788-
without_wildcard
2789+
without_wildcard.to_string()
27892790
} else {
27902791
value.to_string()
27912792
}

0 commit comments

Comments
 (0)