mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-09 02:04:22 +01:00
rename functions
This commit is contained in:
@@ -49,7 +49,7 @@ pub fn vector_extract(args: &[Register]) -> Result<Value> {
|
||||
));
|
||||
}
|
||||
|
||||
let blob = match &args[0].get_owned_value() {
|
||||
let blob = match &args[0].get_value() {
|
||||
Value::Blob(b) => b,
|
||||
_ => {
|
||||
return Err(LimboError::ConversionError(
|
||||
@@ -138,12 +138,12 @@ pub fn vector_slice(args: &[Register]) -> Result<Value> {
|
||||
let vector = parse_vector(&args[0], None)?;
|
||||
|
||||
let start_index = args[1]
|
||||
.get_owned_value()
|
||||
.get_value()
|
||||
.as_int()
|
||||
.ok_or_else(|| LimboError::InvalidArgument("start index must be an integer".into()))?;
|
||||
|
||||
let end_index = args[2]
|
||||
.get_owned_value()
|
||||
.get_value()
|
||||
.as_int()
|
||||
.ok_or_else(|| LimboError::InvalidArgument("end_index must be an integer".into()))?;
|
||||
|
||||
|
||||
@@ -153,13 +153,12 @@ pub fn parse_string_vector(vector_type: VectorType, value: &Value) -> Result<Vec
|
||||
}
|
||||
|
||||
pub fn parse_vector(value: &Register, vec_ty: Option<VectorType>) -> Result<Vector> {
|
||||
match value.get_owned_value().value_type() {
|
||||
ValueType::Text => parse_string_vector(
|
||||
vec_ty.unwrap_or(VectorType::Float32),
|
||||
value.get_owned_value(),
|
||||
),
|
||||
match value.get_value().value_type() {
|
||||
ValueType::Text => {
|
||||
parse_string_vector(vec_ty.unwrap_or(VectorType::Float32), value.get_value())
|
||||
}
|
||||
ValueType::Blob => {
|
||||
let Some(blob) = value.get_owned_value().to_blob() else {
|
||||
let Some(blob) = value.get_value().to_blob() else {
|
||||
return Err(LimboError::ConversionError(
|
||||
"Invalid vector value".to_string(),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user