Give &strs instead of Strings to Database::process’ callback

This commit is contained in:
Ivan Ukhov
2015-06-08 21:42:34 -04:00
parent daefd7d1be
commit 64aa37f474
4 changed files with 30 additions and 12 deletions

View File

@ -13,8 +13,8 @@ fn main() {
"#).unwrap();
database.process("SELECT * FROM `users`;", |pairs| {
for (ref column, ref value) in pairs {
println!("{} = {}", column, value);
for &(column, value) in pairs.iter() {
println!("{} = {}", column, value.unwrap());
}
true
}).unwrap();