diff --git a/lib/src/fnc/mod.rs b/lib/src/fnc/mod.rs index fac11a05..f087cf75 100644 --- a/lib/src/fnc/mod.rs +++ b/lib/src/fnc/mod.rs @@ -127,7 +127,6 @@ pub async fn run(ctx: &Runtime, name: &str, args: Vec) -> Result args::check(ctx, name, args, Args::OneTwo, string::slug), "string::split" => args::check(ctx, name, args, Args::Two, string::split), "string::startsWith" => args::check(ctx, name, args, Args::Two, string::starts_with), - "string::substr" => args::check(ctx, name, args, Args::Three, string::substr), "string::trim" => args::check(ctx, name, args, Args::One, string::trim), "string::uppercase" => args::check(ctx, name, args, Args::One, string::uppercase), "string::words" => args::check(ctx, name, args, Args::One, string::words), diff --git a/lib/src/fnc/string.rs b/lib/src/fnc/string.rs index bebf86bb..dcda954b 100644 --- a/lib/src/fnc/string.rs +++ b/lib/src/fnc/string.rs @@ -72,14 +72,6 @@ pub fn starts_with(_: &Runtime, mut args: Vec) -> Result { Ok(val.starts_with(&chr).into()) } -pub fn substr(_: &Runtime, mut args: Vec) -> Result { - let val = args.remove(0).as_strand(); - let beg = args.remove(0).as_int() as usize; - let lim = args.remove(0).as_int() as usize; - let val = val.value.chars().skip(beg).take(lim).collect::(); - Ok(val.into()) -} - pub fn trim(_: &Runtime, mut args: Vec) -> Result { Ok(args.remove(0).as_strand().value.trim().into()) } diff --git a/lib/src/sql/function.rs b/lib/src/sql/function.rs index 5c80736e..ed5813e4 100644 --- a/lib/src/sql/function.rs +++ b/lib/src/sql/function.rs @@ -377,7 +377,6 @@ fn function_string(i: &str) -> IResult<&str, &str> { tag("string::slug"), tag("string::split"), tag("string::startsWith"), - tag("string::substr"), tag("string::trim"), tag("string::uppercase"), tag("string::words"),