Fix dead code issue from #488 (#583)

This commit is contained in:
Youngsuk Kim 2020-04-12 15:27:42 -04:00 committed by GitHub
parent 579572e030
commit 74e9382d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ use postgres::{Connection, TlsMode, Error};
use std::collections::HashMap;
struct Author {
id: i32,
_id: i32,
name: String,
country: String
}
@ -27,7 +27,7 @@ fn main() -> Result<(), Error> {
for (key, value) in &authors {
let author = Author {
id: 0,
_id: 0,
name: key.to_string(),
country: value.to_string()
};
@ -38,7 +38,7 @@ fn main() -> Result<(), Error> {
for row in &conn.query("SELECT id, name, country FROM author", &[])? {
let author = Author {
id: row.get(0),
_id: row.get(0),
name: row.get(1),
country: row.get(2),
};