Skip to content

Commit e915b94

Browse files
committed
serialize/value: Allow Box<str> serialization
We already had an SerializeValue impl for Box<T>, and for &str. The problem is that Box<str>, as you can see, contains str instead of &str, so the Box SerializeValue impl could not use that.
1 parent e732aaa commit e915b94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scylla-cql/src/serialize/value.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl SerializeValue for num_bigint_04::BigInt {
294294
.map_err(|_| mk_ser_err::<Self>(typ, BuiltinSerializationErrorKind::SizeOverflow))?
295295
});
296296
}
297-
impl SerializeValue for &str {
297+
impl SerializeValue for str {
298298
impl_serialize_via_writer!(|me, typ, writer| {
299299
exact_type_check!(typ, Ascii, Text);
300300
writer
@@ -1066,7 +1066,7 @@ pub struct BuiltinTypeCheckError {
10661066
pub kind: BuiltinTypeCheckErrorKind,
10671067
}
10681068

1069-
fn mk_typck_err<T>(
1069+
fn mk_typck_err<T: ?Sized>(
10701070
got: &ColumnType,
10711071
kind: impl Into<BuiltinTypeCheckErrorKind>,
10721072
) -> SerializationError {
@@ -1099,7 +1099,7 @@ pub struct BuiltinSerializationError {
10991099
pub kind: BuiltinSerializationErrorKind,
11001100
}
11011101

1102-
pub(crate) fn mk_ser_err<T>(
1102+
pub(crate) fn mk_ser_err<T: ?Sized>(
11031103
got: &ColumnType,
11041104
kind: impl Into<BuiltinSerializationErrorKind>,
11051105
) -> SerializationError {

0 commit comments

Comments
 (0)