Adjust the example

This commit is contained in:
Ivan Ukhov 2015-07-04 10:24:01 -04:00
parent acf1211eb4
commit 0390d179d5
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ connection.process("SELECT * FROM `users`;", |pairs| {
}).unwrap();
let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
while statement.step().unwrap() == sqlite::State::Row {
while let sqlite::State::Row = statement.step().unwrap() {
println!("id = {}", statement.read::<i64>(0).unwrap());
println!("name = {}", statement.read::<String>(1).unwrap());
}

View File

@ -18,7 +18,7 @@
//! }).unwrap();
//!
//! let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
//! while statement.step().unwrap() == sqlite::State::Row {
//! while let sqlite::State::Row = statement.step().unwrap() {
//! println!("id = {}", statement.read::<i64>(0).unwrap());
//! println!("name = {}", statement.read::<String>(1).unwrap());
//! }