Commit 5c71314 1 parent 8065379 commit 5c71314 Copy full SHA for 5c71314
File tree 1 file changed +10
-6
lines changed
scylla-cql/src/types/serialize
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1574,17 +1574,21 @@ mod tests {
1574
1574
assert_eq ! ( typed_data, erased_data) ;
1575
1575
}
1576
1576
1577
- fn do_serialize < T : SerializeCql > ( t : T , typ : & ColumnType ) -> Vec < u8 > {
1577
+ fn do_serialize_result < T : SerializeCql > (
1578
+ t : T ,
1579
+ typ : & ColumnType ,
1580
+ ) -> Result < Vec < u8 > , SerializationError > {
1578
1581
let mut ret = Vec :: new ( ) ;
1579
1582
let writer = CellWriter :: new ( & mut ret) ;
1580
- t. serialize ( typ, writer) . unwrap ( ) ;
1581
- ret
1583
+ t. serialize ( typ, writer) . map ( |_| ( ) ) . map ( |( ) | ret)
1584
+ }
1585
+
1586
+ fn do_serialize < T : SerializeCql > ( t : T , typ : & ColumnType ) -> Vec < u8 > {
1587
+ do_serialize_result ( t, typ) . unwrap ( )
1582
1588
}
1583
1589
1584
1590
fn do_serialize_err < T : SerializeCql > ( t : T , typ : & ColumnType ) -> SerializationError {
1585
- let mut ret = Vec :: new ( ) ;
1586
- let writer = CellWriter :: new ( & mut ret) ;
1587
- t. serialize ( typ, writer) . unwrap_err ( )
1591
+ do_serialize_result ( t, typ) . unwrap_err ( )
1588
1592
}
1589
1593
1590
1594
#[ test]
You can’t perform that action at this time.
0 commit comments