We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4909d7e commit 4de9669Copy full SHA for 4de9669
scylla-cql/src/frame/response/cql_to_rust.rs
@@ -1000,4 +1000,24 @@ mod tests {
1000
})
1001
);
1002
}
1003
+
1004
+ #[test]
1005
+ fn unnamed_struct_from_row() {
1006
+ #[derive(FromRow)]
1007
+ struct MyRow(i32, Option<String>, Option<Vec<i32>>);
1008
1009
+ let row = Row {
1010
+ columns: vec![
1011
+ Some(CqlValue::Int(16)),
1012
+ None,
1013
+ Some(CqlValue::Set(vec![CqlValue::Int(1), CqlValue::Int(2)])),
1014
+ ],
1015
+ };
1016
1017
+ let my_row: MyRow = MyRow::from_row(row).unwrap();
1018
1019
+ assert_eq!(my_row.0, 16);
1020
+ assert_eq!(my_row.1, None);
1021
+ assert_eq!(my_row.2, Some(vec![1, 2]));
1022
+ }
1023
0 commit comments