Skip to content

Commit

Permalink
use contains instead of find
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Feb 22, 2024
1 parent bce64a6 commit 32314b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/handler/create_sql_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ pub const SQL_UDF_PATTERN: &str = "[sql udf]";
/// it's possible to improve the display to users
fn validate_err_msg(invalid_msg: &str) -> ErrMsgType {
// First try invalid parameters
if invalid_msg.find(SQL_UDF_PATTERN).is_some() {
if invalid_msg.contains(SQL_UDF_PATTERN) {
ErrMsgType::Parameter
} else if invalid_msg.find(FUNCTION_KEYWORD).is_some() {
} else if invalid_msg.contains(FUNCTION_KEYWORD) {
ErrMsgType::Function
} else {
// Nothing could be better display
Expand Down

0 comments on commit 32314b4

Please sign in to comment.