@@ -1149,17 +1149,14 @@ impl Display for BuiltinTypeCheckErrorKind {
1149
1149
write ! ( f, "expected one of the CQL types: {expected:?}" )
1150
1150
}
1151
1151
BuiltinTypeCheckErrorKind :: NotEmptyable => {
1152
- write ! (
1153
- f,
1154
- "the separate empty representation is not valid for this type"
1155
- )
1152
+ f. write_str ( "the separate empty representation is not valid for this type" )
1156
1153
}
1157
1154
BuiltinTypeCheckErrorKind :: SetOrListError ( err) => err. fmt ( f) ,
1158
1155
BuiltinTypeCheckErrorKind :: MapError ( err) => err. fmt ( f) ,
1159
1156
BuiltinTypeCheckErrorKind :: TupleError ( err) => err. fmt ( f) ,
1160
1157
BuiltinTypeCheckErrorKind :: UdtError ( err) => err. fmt ( f) ,
1161
1158
BuiltinTypeCheckErrorKind :: CustomTypeUnsupported => {
1162
- write ! ( f , "custom CQL types are unsupported" )
1159
+ f . write_str ( "custom CQL types are unsupported" )
1163
1160
}
1164
1161
}
1165
1162
}
@@ -1217,16 +1214,10 @@ impl Display for BuiltinSerializationErrorKind {
1217
1214
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1218
1215
match self {
1219
1216
BuiltinSerializationErrorKind :: SizeOverflow => {
1220
- write ! (
1221
- f,
1222
- "the Rust value is too big to be serialized in the CQL protocol format"
1223
- )
1217
+ f. write_str ( "the Rust value is too big to be serialized in the CQL protocol format" )
1224
1218
}
1225
1219
BuiltinSerializationErrorKind :: ValueOverflow => {
1226
- write ! (
1227
- f,
1228
- "the Rust value is out of range supported by the CQL type"
1229
- )
1220
+ f. write_str ( "the Rust value is out of range supported by the CQL type" )
1230
1221
}
1231
1222
BuiltinSerializationErrorKind :: SetOrListError ( err) => err. fmt ( f) ,
1232
1223
BuiltinSerializationErrorKind :: MapError ( err) => err. fmt ( f) ,
@@ -1247,12 +1238,9 @@ pub enum MapTypeCheckErrorKind {
1247
1238
impl Display for MapTypeCheckErrorKind {
1248
1239
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1249
1240
match self {
1250
- MapTypeCheckErrorKind :: NotMap => {
1251
- write ! (
1252
- f,
1253
- "the CQL type the map was attempted to be serialized to was not map"
1254
- )
1255
- }
1241
+ MapTypeCheckErrorKind :: NotMap => f. write_str (
1242
+ "the CQL type the Rust type was attempted to be type checked against was not a map" ,
1243
+ ) ,
1256
1244
}
1257
1245
}
1258
1246
}
@@ -1275,10 +1263,7 @@ impl Display for MapSerializationErrorKind {
1275
1263
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1276
1264
match self {
1277
1265
MapSerializationErrorKind :: TooManyElements => {
1278
- write ! (
1279
- f,
1280
- "the map contains too many elements to fit in CQL representation"
1281
- )
1266
+ f. write_str ( "the map contains too many elements to fit in CQL representation" )
1282
1267
}
1283
1268
MapSerializationErrorKind :: KeySerializationFailed ( err) => {
1284
1269
write ! ( f, "failed to serialize one of the keys: {}" , err)
@@ -1302,10 +1287,7 @@ impl Display for SetOrListTypeCheckErrorKind {
1302
1287
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1303
1288
match self {
1304
1289
SetOrListTypeCheckErrorKind :: NotSetOrList => {
1305
- write ! (
1306
- f,
1307
- "the CQL type the tuple was attempted to was neither a set or a list"
1308
- )
1290
+ f. write_str ( "the CQL type the Rust type was attempted to be type checked against was neither a set or a list" )
1309
1291
}
1310
1292
}
1311
1293
}
@@ -1325,12 +1307,9 @@ pub enum SetOrListSerializationErrorKind {
1325
1307
impl Display for SetOrListSerializationErrorKind {
1326
1308
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1327
1309
match self {
1328
- SetOrListSerializationErrorKind :: TooManyElements => {
1329
- write ! (
1330
- f,
1331
- "the collection contains too many elements to fit in CQL representation"
1332
- )
1333
- }
1310
+ SetOrListSerializationErrorKind :: TooManyElements => f. write_str (
1311
+ "the collection contains too many elements to fit in CQL representation" ,
1312
+ ) ,
1334
1313
SetOrListSerializationErrorKind :: ElementSerializationFailed ( err) => {
1335
1314
write ! ( f, "failed to serialize one of the elements: {err}" )
1336
1315
}
@@ -1362,14 +1341,10 @@ pub enum TupleTypeCheckErrorKind {
1362
1341
impl Display for TupleTypeCheckErrorKind {
1363
1342
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1364
1343
match self {
1365
- TupleTypeCheckErrorKind :: NotTuple => write ! (
1366
- f,
1367
- "the CQL type the tuple was attempted to be serialized to is not a tuple"
1344
+ TupleTypeCheckErrorKind :: NotTuple => f. write_str (
1345
+ "the CQL type the Rust type was attempted to be type checked against is not a tuple"
1368
1346
) ,
1369
- TupleTypeCheckErrorKind :: WrongElementCount {
1370
- rust_type_el_count,
1371
- cql_type_el_count,
1372
- } => write ! (
1347
+ TupleTypeCheckErrorKind :: WrongElementCount { rust_type_el_count, cql_type_el_count } => write ! (
1373
1348
f,
1374
1349
"wrong tuple element count: CQL type has {cql_type_el_count}, the Rust tuple has {rust_type_el_count}"
1375
1350
) ,
@@ -1442,10 +1417,7 @@ pub enum UdtTypeCheckErrorKind {
1442
1417
impl Display for UdtTypeCheckErrorKind {
1443
1418
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1444
1419
match self {
1445
- UdtTypeCheckErrorKind :: NotUdt => write ! (
1446
- f,
1447
- "the CQL type the tuple was attempted to be type checked against is not a UDT"
1448
- ) ,
1420
+ UdtTypeCheckErrorKind :: NotUdt => f. write_str ( "the CQL type the Rust type was attempted to be type checked against is not a UDT" ) ,
1449
1421
UdtTypeCheckErrorKind :: NameMismatch {
1450
1422
keyspace,
1451
1423
type_name,
0 commit comments