Skip to content

Commit

Permalink
Switch examples to new macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorak-mmk committed Dec 5, 2023
1 parent 6b50b28 commit eb27634
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/user-defined-type.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use scylla::macros::{FromUserType, IntoUserType};
use scylla::{IntoTypedRows, Session, SessionBuilder};
use scylla::macros::FromUserType;
use scylla::{IntoTypedRows, SerializeCql, Session, SessionBuilder};
use std::env;

#[tokio::main]
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {

// Define custom struct that matches User Defined Type created earlier
// wrapping field in Option will gracefully handle null field values
#[derive(Debug, IntoUserType, FromUserType)]
#[derive(Debug, SerializeCql, FromUserType)]
struct MyType {
int_val: i32,
text_val: Option<String>,
Expand Down
4 changes: 2 additions & 2 deletions examples/value_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async fn main() {
.await
.unwrap();

#[derive(scylla::ValueList)]
#[derive(scylla::SerializeRow)]
struct MyType<'a> {
k: i32,
my: Option<&'a str>,
Expand All @@ -36,7 +36,7 @@ async fn main() {
.unwrap();

// You can also use type generics:
#[derive(scylla::ValueList)]
#[derive(scylla::SerializeRow)]
struct MyTypeWithGenerics<S: scylla::frame::value::Value> {
k: i32,
my: Option<S>,
Expand Down

0 comments on commit eb27634

Please sign in to comment.