File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
scylla-cql/src/types/serialize
scylla-macros/src/serialize Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1568,6 +1568,23 @@ pub(crate) mod tests {
15681568 assert_eq ! ( reference, row) ;
15691569 }
15701570
1571+ #[ test]
1572+ fn test_row_serialization_with_not_rust_idents ( ) {
1573+ #[ derive( SerializeRow , Debug ) ]
1574+ #[ scylla( crate = crate ) ]
1575+ struct RowWithTTL {
1576+ #[ scylla( rename = "[ttl]" ) ]
1577+ ttl : i32 ,
1578+ }
1579+
1580+ let spec = [ col ( "[ttl]" , ColumnType :: Int ) ] ;
1581+
1582+ let reference = do_serialize ( ( 42i32 , ) , & spec) ;
1583+ let row = do_serialize ( RowWithTTL { ttl : 42 } , & spec) ;
1584+
1585+ assert_eq ! ( reference, row) ;
1586+ }
1587+
15711588 #[ derive( SerializeRow , Debug ) ]
15721589 #[ scylla( crate = crate ) ]
15731590 struct TestRowWithSkippedFields {
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ impl Generator for ColumnSortingGenerator<'_> {
223223 statements. push ( self . ctx . generate_mk_ser_err ( ) ) ;
224224
225225 // Generate a "visited" flag for each field
226- let visited_flag_names = rust_field_names
226+ let visited_flag_names = rust_field_idents
227227 . iter ( )
228228 . map ( |s| syn:: Ident :: new ( & format ! ( "visited_flag_{}" , s) , Span :: call_site ( ) ) )
229229 . collect :: < Vec < _ > > ( ) ;
You can’t perform that action at this time.
0 commit comments