33
44use anyhow:: Result ;
55use chrono:: { DateTime , NaiveDate , NaiveTime , Utc } ;
6- use futures:: { StreamExt , TryStreamExt } ;
6+ use futures:: { StreamExt as _ , TryStreamExt as _ } ;
77use scylla:: frame:: response:: result:: CqlValue ;
88use scylla:: frame:: value:: { CqlDate , CqlTime , CqlTimestamp } ;
99use scylla:: transport:: session:: Session ;
@@ -44,7 +44,7 @@ async fn main() -> Result<()> {
4444 let mut iter = session
4545 . query_iter ( "SELECT d from examples_ks.dates" , & [ ] )
4646 . await ?
47- . into_typed :: < ( NaiveDate , ) > ( ) ;
47+ . rows_stream :: < ( NaiveDate , ) > ( ) ? ;
4848 while let Some ( row_result) = iter. next ( ) . await {
4949 let ( read_date, ) : ( NaiveDate , ) = match row_result {
5050 Ok ( read_date) => read_date,
@@ -66,7 +66,7 @@ async fn main() -> Result<()> {
6666 let mut iter = session
6767 . query_iter ( "SELECT d from examples_ks.dates" , & [ ] )
6868 . await ?
69- . into_typed :: < ( time:: Date , ) > ( ) ;
69+ . rows_stream :: < ( time:: Date , ) > ( ) ? ;
7070 while let Some ( row_result) = iter. next ( ) . await {
7171 let ( read_date, ) : ( time:: Date , ) = match row_result {
7272 Ok ( read_date) => read_date,
@@ -88,7 +88,7 @@ async fn main() -> Result<()> {
8888 let mut iter = session
8989 . query_iter ( "SELECT d from examples_ks.dates" , & [ ] )
9090 . await ?
91- . into_typed :: < ( CqlValue , ) > ( ) ;
91+ . rows_stream :: < ( CqlValue , ) > ( ) ? ;
9292 while let Some ( row_result) = iter. next ( ) . await {
9393 let read_days: u32 = match row_result {
9494 Ok ( ( CqlValue :: Date ( CqlDate ( days) ) , ) ) => days,
@@ -124,7 +124,7 @@ async fn main() -> Result<()> {
124124 let mut iter = session
125125 . query_iter ( "SELECT d from examples_ks.times" , & [ ] )
126126 . await ?
127- . into_typed :: < ( NaiveTime , ) > ( ) ;
127+ . rows_stream :: < ( NaiveTime , ) > ( ) ? ;
128128 while let Some ( ( read_time, ) ) = iter. try_next ( ) . await ? {
129129 println ! ( "Parsed a time into chrono::NaiveTime: {:?}" , read_time) ;
130130 }
@@ -139,7 +139,7 @@ async fn main() -> Result<()> {
139139 let mut iter = session
140140 . query_iter ( "SELECT d from examples_ks.times" , & [ ] )
141141 . await ?
142- . into_typed :: < ( time:: Time , ) > ( ) ;
142+ . rows_stream :: < ( time:: Time , ) > ( ) ? ;
143143 while let Some ( ( read_time, ) ) = iter. try_next ( ) . await ? {
144144 println ! ( "Parsed a time into time::Time: {:?}" , read_time) ;
145145 }
@@ -154,7 +154,7 @@ async fn main() -> Result<()> {
154154 let mut iter = session
155155 . query_iter ( "SELECT d from examples_ks.times" , & [ ] )
156156 . await ?
157- . into_typed :: < ( CqlTime , ) > ( ) ;
157+ . rows_stream :: < ( CqlTime , ) > ( ) ? ;
158158 while let Some ( ( read_time, ) ) = iter. try_next ( ) . await ? {
159159 println ! ( "Read a time as raw nanos: {:?}" , read_time) ;
160160 }
@@ -185,7 +185,7 @@ async fn main() -> Result<()> {
185185 let mut iter = session
186186 . query_iter ( "SELECT d from examples_ks.timestamps" , & [ ] )
187187 . await ?
188- . into_typed :: < ( DateTime < Utc > , ) > ( ) ;
188+ . rows_stream :: < ( DateTime < Utc > , ) > ( ) ? ;
189189 while let Some ( ( read_time, ) ) = iter. try_next ( ) . await ? {
190190 println ! (
191191 "Parsed a timestamp into chrono::DateTime<chrono::Utc>: {:?}" ,
@@ -206,7 +206,7 @@ async fn main() -> Result<()> {
206206 let mut iter = session
207207 . query_iter ( "SELECT d from examples_ks.timestamps" , & [ ] )
208208 . await ?
209- . into_typed :: < ( time:: OffsetDateTime , ) > ( ) ;
209+ . rows_stream :: < ( time:: OffsetDateTime , ) > ( ) ? ;
210210 while let Some ( ( read_time, ) ) = iter. try_next ( ) . await ? {
211211 println ! (
212212 "Parsed a timestamp into time::OffsetDateTime: {:?}" ,
@@ -227,7 +227,7 @@ async fn main() -> Result<()> {
227227 let mut iter = session
228228 . query_iter ( "SELECT d from examples_ks.timestamps" , & [ ] )
229229 . await ?
230- . into_typed :: < ( CqlTimestamp , ) > ( ) ;
230+ . rows_stream :: < ( CqlTimestamp , ) > ( ) ? ;
231231 while let Some ( ( read_time, ) ) = iter. try_next ( ) . await ? {
232232 println ! ( "Read a timestamp as raw millis: {:?}" , read_time) ;
233233 }
0 commit comments