mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-06 09:44:21 +01:00
remove Result from signature
This commit is contained in:
@@ -44,7 +44,7 @@ pub fn get_json(json_value: &Value, indent: Option<&str>) -> crate::Result<Value
|
||||
let json_val = convert_dbtype_to_jsonb(json_value, Conv::Strict)?;
|
||||
let json = match indent {
|
||||
Some(indent) => json_val.to_string_pretty(Some(indent))?,
|
||||
None => json_val.to_string()?,
|
||||
None => json_val.to_string(),
|
||||
};
|
||||
|
||||
Ok(Value::Text(Text::json(json)))
|
||||
@@ -53,7 +53,7 @@ pub fn get_json(json_value: &Value, indent: Option<&str>) -> crate::Result<Value
|
||||
let jsonbin = Jsonb::new(b.len(), Some(b));
|
||||
jsonbin.element_type()?;
|
||||
Ok(Value::Text(Text {
|
||||
value: jsonbin.to_string()?.into_bytes(),
|
||||
value: jsonbin.to_string().into_bytes(),
|
||||
subtype: TextSubtype::Json,
|
||||
}))
|
||||
}
|
||||
@@ -285,7 +285,7 @@ pub fn json_arrow_extract(
|
||||
let res = json.operate_on_path(&path, &mut op);
|
||||
let extracted = op.result();
|
||||
if res.is_ok() {
|
||||
Ok(Value::Text(Text::json(extracted.to_string()?)))
|
||||
Ok(Value::Text(Text::json(extracted.to_string())))
|
||||
} else {
|
||||
Ok(Value::Null)
|
||||
}
|
||||
@@ -438,7 +438,7 @@ pub fn json_string_to_db_type(
|
||||
element_type: ElementType,
|
||||
flag: OutputVariant,
|
||||
) -> crate::Result<Value> {
|
||||
let mut json_string = json.to_string()?;
|
||||
let mut json_string = json.to_string();
|
||||
if matches!(flag, OutputVariant::Binary) {
|
||||
return Ok(Value::Blob(json.data()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user