Reduce the number of semicolons in the examples

This commit is contained in:
Ivan Ukhov 2015-07-07 09:37:09 -04:00
parent 557fbeb12d
commit 5f3753e691
2 changed files with 4 additions and 4 deletions

View File

@ -14,14 +14,14 @@ connection.execute("
INSERT INTO `users` (id, name) VALUES (1, 'Alice'); INSERT INTO `users` (id, name) VALUES (1, 'Alice');
").unwrap(); ").unwrap();
connection.process("SELECT * FROM `users`;", |pairs| { connection.process("SELECT * FROM `users`", |pairs| {
for &(column, value) in pairs.iter() { for &(column, value) in pairs.iter() {
println!("{} = {}", column, value.unwrap()); println!("{} = {}", column, value.unwrap());
} }
true true
}).unwrap(); }).unwrap();
let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap(); let mut statement = connection.prepare("SELECT * FROM `users`").unwrap();
while let sqlite::State::Row = statement.step().unwrap() { while let sqlite::State::Row = statement.step().unwrap() {
println!("id = {}", statement.read::<i64>(0).unwrap()); println!("id = {}", statement.read::<i64>(0).unwrap());
println!("name = {}", statement.read::<String>(1).unwrap()); println!("name = {}", statement.read::<String>(1).unwrap());

View File

@ -10,14 +10,14 @@
//! INSERT INTO `users` (id, name) VALUES (1, 'Alice'); //! INSERT INTO `users` (id, name) VALUES (1, 'Alice');
//! ").unwrap(); //! ").unwrap();
//! //!
//! connection.process("SELECT * FROM `users`;", |pairs| { //! connection.process("SELECT * FROM `users`", |pairs| {
//! for &(column, value) in pairs.iter() { //! for &(column, value) in pairs.iter() {
//! println!("{} = {}", column, value.unwrap()); //! println!("{} = {}", column, value.unwrap());
//! } //! }
//! true //! true
//! }).unwrap(); //! }).unwrap();
//! //!
//! let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap(); //! let mut statement = connection.prepare("SELECT * FROM `users`").unwrap();
//! while let sqlite::State::Row = statement.step().unwrap() { //! while let sqlite::State::Row = statement.step().unwrap() {
//! println!("id = {}", statement.read::<i64>(0).unwrap()); //! println!("id = {}", statement.read::<i64>(0).unwrap());
//! println!("name = {}", statement.read::<String>(1).unwrap()); //! println!("name = {}", statement.read::<String>(1).unwrap());