@@ -43,8 +43,8 @@ pub fn get_json(json_value: &OwnedValue, indent: Option<&str>) -> crate::Result<
43
43
44
44
let json_val = get_json_value ( json_value) ?;
45
45
let json = match indent {
46
- Some ( indent) => to_string_pretty ( & json_val, indent) . unwrap ( ) ,
47
- None => to_string ( & json_val) . unwrap ( ) ,
46
+ Some ( indent) => to_string_pretty ( & json_val, indent) ? ,
47
+ None => to_string ( & json_val) ? ,
48
48
} ;
49
49
50
50
Ok ( OwnedValue :: Text ( LimboText :: json ( Rc :: new ( json) ) ) )
@@ -62,8 +62,8 @@ pub fn get_json(json_value: &OwnedValue, indent: Option<&str>) -> crate::Result<
62
62
_ => {
63
63
let json_val = get_json_value ( json_value) ?;
64
64
let json = match indent {
65
- Some ( indent) => to_string_pretty ( & json_val, indent) . unwrap ( ) ,
66
- None => to_string ( & json_val) . unwrap ( ) ,
65
+ Some ( indent) => to_string_pretty ( & json_val, indent) ? ,
66
+ None => to_string ( & json_val) ? ,
67
67
} ;
68
68
69
69
Ok ( OwnedValue :: Text ( LimboText :: json ( Rc :: new ( json) ) ) )
@@ -166,7 +166,7 @@ pub fn json_arrow_extract(value: &OwnedValue, path: &OwnedValue) -> crate::Resul
166
166
let extracted = json_extract_single ( & json, path, false ) ?;
167
167
168
168
if let Some ( val) = extracted {
169
- let json = to_string ( val) . unwrap ( ) ;
169
+ let json = to_string ( val) ? ;
170
170
171
171
Ok ( OwnedValue :: Text ( LimboText :: json ( Rc :: new ( json) ) ) )
172
172
} else {
@@ -223,7 +223,7 @@ pub fn json_extract(value: &OwnedValue, paths: &[OwnedValue]) -> crate::Result<O
223
223
return Ok ( OwnedValue :: Null ) ;
224
224
}
225
225
226
- result. push_str ( & to_string ( & extracted) . unwrap ( ) ) ;
226
+ result. push_str ( & to_string ( & extracted) ? ) ;
227
227
result. push ( ',' ) ;
228
228
}
229
229
}
@@ -261,7 +261,7 @@ fn convert_json_to_db_type(extracted: &Val, all_as_db: bool) -> crate::Result<Ow
261
261
}
262
262
Val :: String ( s) => Ok ( OwnedValue :: Text ( LimboText :: new ( Rc :: new ( s. clone ( ) ) ) ) ) ,
263
263
_ => {
264
- let json = to_string ( & extracted) . unwrap ( ) ;
264
+ let json = to_string ( & extracted) ? ;
265
265
if all_as_db {
266
266
Ok ( OwnedValue :: Text ( LimboText :: new ( Rc :: new ( json) ) ) )
267
267
} else {
@@ -516,7 +516,7 @@ pub fn json_object(values: &[OwnedValue]) -> crate::Result<OwnedValue> {
516
516
} )
517
517
. collect :: < Result < IndexMap < String , Val > , _ > > ( ) ?;
518
518
519
- let result = crate :: json:: to_string ( & value_map) . unwrap ( ) ;
519
+ let result = crate :: json:: to_string ( & value_map) ? ;
520
520
Ok ( OwnedValue :: Text ( LimboText :: json ( Rc :: new ( result) ) ) )
521
521
}
522
522
0 commit comments