Skip to content

Commit 7435547

Browse files
committed
Merge pull request #186 from tshepang/patch-1
README: add trailing commas and rid of some whitespace (for consistency)
2 parents 8a0fed9 + 1a12757 commit 7435547

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ use postgres::{Connection, SslMode};
2222
struct Person {
2323
id: i32,
2424
name: String,
25-
data: Option<Vec<u8>>
25+
data: Option<Vec<u8>>,
2626
}
2727

2828
fn main() {
29-
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None)
30-
.unwrap();
31-
29+
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();
3230
conn.execute("CREATE TABLE person (
3331
id SERIAL PRIMARY KEY,
3432
name VARCHAR NOT NULL,
@@ -37,16 +35,15 @@ fn main() {
3735
let me = Person {
3836
id: 0,
3937
name: "Steven".to_string(),
40-
data: None
38+
data: None,
4139
};
4240
conn.execute("INSERT INTO person (name, data) VALUES ($1, $2)",
4341
&[&me.name, &me.data]).unwrap();
44-
4542
for row in &conn.query("SELECT id, name, data FROM person", &[]).unwrap() {
4643
let person = Person {
4744
id: row.get(0),
4845
name: row.get(1),
49-
data: row.get(2)
46+
data: row.get(2),
5047
};
5148
println!("Found person {}", person.name);
5249
}

0 commit comments

Comments
 (0)