From d5fab4fbf00c44cbef1d518ff6254764566e2381 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sat, 30 Apr 2022 21:47:19 +0100 Subject: [PATCH] Remove string::contains() SQL function --- lib/src/fnc/mod.rs | 1 - lib/src/fnc/string.rs | 6 ------ lib/src/sql/function.rs | 1 - 3 files changed, 8 deletions(-) diff --git a/lib/src/fnc/mod.rs b/lib/src/fnc/mod.rs index cb372a0e..fac11a05 100644 --- a/lib/src/fnc/mod.rs +++ b/lib/src/fnc/mod.rs @@ -116,7 +116,6 @@ pub async fn run(ctx: &Runtime, name: &str, args: Vec) -> Result args::check(ctx, name, args, Args::None, rand::rand), // "string::concat" => args::check(ctx, name, args, Args::Any, string::concat), - "string::contains" => args::check(ctx, name, args, Args::Two, string::contains), "string::endsWith" => args::check(ctx, name, args, Args::Two, string::ends_with), "string::join" => args::check(ctx, name, args, Args::Any, string::join), "string::length" => args::check(ctx, name, args, Args::One, string::length), diff --git a/lib/src/fnc/string.rs b/lib/src/fnc/string.rs index 6f6cea56..bebf86bb 100644 --- a/lib/src/fnc/string.rs +++ b/lib/src/fnc/string.rs @@ -7,12 +7,6 @@ pub fn concat(_: &Runtime, args: Vec) -> Result { Ok(args.into_iter().map(|x| x.as_strand().value).collect::>().concat().into()) } -pub fn contains(_: &Runtime, mut args: Vec) -> Result { - let val = args.remove(0).as_strand().value; - let str = args.remove(0).as_strand().value; - Ok(val.contains(&str).into()) -} - pub fn ends_with(_: &Runtime, mut args: Vec) -> Result { let val = args.remove(0).as_strand().value; let chr = args.remove(0).as_strand().value; diff --git a/lib/src/sql/function.rs b/lib/src/sql/function.rs index e59e84a0..d986b7ac 100644 --- a/lib/src/sql/function.rs +++ b/lib/src/sql/function.rs @@ -366,7 +366,6 @@ fn function_rand(i: &str) -> IResult<&str, &str> { fn function_string(i: &str) -> IResult<&str, &str> { alt(( tag("string::concat"), - tag("string::contains"), tag("string::endsWith"), tag("string::join"), tag("string::length"),