remove Result from signature

This commit is contained in:
Mikaël Francoeur
2025-08-21 10:50:33 -04:00
parent 05f4cec34d
commit 5ed2abf23f
2 changed files with 70 additions and 73 deletions

View File

@@ -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()));
}