diff --git a/scylla-cql/src/types/serialize/value.rs b/scylla-cql/src/types/serialize/value.rs index b896b6a528..621ec8f416 100644 --- a/scylla-cql/src/types/serialize/value.rs +++ b/scylla-cql/src/types/serialize/value.rs @@ -1574,17 +1574,21 @@ mod tests { assert_eq!(typed_data, erased_data); } - fn do_serialize(t: T, typ: &ColumnType) -> Vec { + fn do_serialize_result( + t: T, + typ: &ColumnType, + ) -> Result, SerializationError> { let mut ret = Vec::new(); let writer = CellWriter::new(&mut ret); - t.serialize(typ, writer).unwrap(); - ret + t.serialize(typ, writer).map(|_| ()).map(|()| ret) + } + + fn do_serialize(t: T, typ: &ColumnType) -> Vec { + do_serialize_result(t, typ).unwrap() } fn do_serialize_err(t: T, typ: &ColumnType) -> SerializationError { - let mut ret = Vec::new(); - let writer = CellWriter::new(&mut ret); - t.serialize(typ, writer).unwrap_err() + do_serialize_result(t, typ).unwrap_err() } #[test]