Rename SQL string::length() function to string::len()

This commit is contained in:
Tobie Morgan Hitchcock 2023-02-18 21:07:37 +00:00
parent 132354e199
commit 5e2157a0a2
3 changed files with 3 additions and 3 deletions

View file

@ -180,7 +180,7 @@ pub fn synchronous(ctx: &Context<'_>, name: &str, args: Vec<Value>) -> Result<Va
"string::concat" => string::concat,
"string::endsWith" => string::ends_with,
"string::join" => string::join,
"string::length" => string::length,
"string::len" => string::len,
"string::lowercase" => string::lowercase,
"string::repeat" => string::repeat,
"string::replace" => string::replace,

View file

@ -22,7 +22,7 @@ pub fn join(args: Vec<Value>) -> Result<Value, Error> {
Ok(val.into())
}
pub fn length((string,): (String,)) -> Result<Value, Error> {
pub fn len((string,): (String,)) -> Result<Value, Error> {
let num = string.chars().count() as i64;
Ok(num.into())
}

View file

@ -420,7 +420,7 @@ fn function_string(i: &str) -> IResult<&str, &str> {
tag("string::concat"),
tag("string::endsWith"),
tag("string::join"),
tag("string::length"),
tag("string::len"),
tag("string::lowercase"),
tag("string::repeat"),
tag("string::replace"),