Skip to content

Commit 9d5e5cf

Browse files
committed
{ListLike,Udt,Map,Vector}Iterator: Derive Debug and Clone
For ListLikeIterator Debug will be neede by tests introduced in further commits. Clone and Debug are useful in general, so lets derive them preemptively.
1 parent e217bee commit 9d5e5cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scylla-cql/src/deserialize/value.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ make_error_replace_rust_name!(
698698
// lists and sets
699699

700700
/// An iterator over either a CQL set or list.
701+
#[derive(Debug, Clone)]
701702
pub struct ListlikeIterator<'frame, 'metadata, T> {
702703
coll_typ: &'metadata ColumnType<'metadata>,
703704
elem_typ: &'metadata ColumnType<'metadata>,
@@ -950,6 +951,7 @@ where
950951
/// It would be nice to have a rule to determine if the element type is fixed-length or not,
951952
/// however, we only have a heuristic. There are a few types that should, for all intents and purposes,
952953
/// be considered fixed-length, but are not, e.g TinyInt. See ColumnType::type_size() for the list.
954+
#[derive(Debug, Clone)]
953955
pub struct VectorIterator<'frame, 'metadata, T> {
954956
collection_type: &'metadata ColumnType<'metadata>,
955957
element_type: &'metadata ColumnType<'metadata>,
@@ -1108,6 +1110,7 @@ where
11081110
}
11091111

11101112
/// An iterator over a CQL map.
1113+
#[derive(Debug, Clone)]
11111114
pub struct MapIterator<'frame, 'metadata, K, V> {
11121115
coll_typ: &'metadata ColumnType<'metadata>,
11131116
k_typ: &'metadata ColumnType<'metadata>,
@@ -1423,6 +1426,7 @@ impl_tuple_multiple!(
14231426
/// - `None` - missing from the serialized form
14241427
/// - `Some(None)` - present, but null
14251428
/// - `Some(Some(...))` - non-null, present value
1429+
#[derive(Debug, Clone)]
14261430
pub struct UdtIterator<'frame, 'metadata> {
14271431
all_fields: &'metadata [(Cow<'metadata, str>, ColumnType<'metadata>)],
14281432
type_name: &'metadata str,

0 commit comments

Comments
 (0)